Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP.NET Pop Up Screen with QueryString

Posted on 2008-06-19
5
Medium Priority
?
464 Views
Last Modified: 2013-11-26
Hi experts,

How can I use querystring to link Pop Up screen in ASP.,NET?
My querystring ID is pre-stored in pubVars.pubTicketID. Then I tried to use it like #1. ==> ERROR
If I give number value instead of using variable name like #2, it's GOOD

Thanks,


#1. QueryString value from Public .===> ERROR
<input onclick="window.open('StockPress.aspx?ID=&pubVars.pubTicketID','','width=980,height=300');" type="button"
        value="STOCK" style="width: 156px" /></td>

#2. QueryString value with number ==> GOOD
<input onclick="window.open('StockPress.aspx?ID1234,'','width=980,height=300');" type="button"
        value="STOCK" style="width: 156px" /></td>

#3. Public assign
Public Class pubVars
    Public Shared pubTicketID As String
End Class


0
Comment
Question by:Takeoutdinner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Dxpert
ID: 21826421
This should work:

<input onclick="window.open('StockPress.aspx?ID=" & pubVars.pubTicketID & "','','width=980,height=300');" type="button" value="STOCK" style="width: 156px" /></td>

Open in new window

0
 
LVL 10

Expert Comment

by:Dxpert
ID: 21826446
Sorry, I got confused... this should work:


<input onclick="window.open('StockPress.aspx?ID=<%response.write(pubVars.pubTicketID)%>','','width=980,height=300');" type="button" value="STOCK" style="width: 156px" /></td>

Open in new window

0
 

Author Comment

by:Takeoutdinner
ID: 21830538
Thanks Dxpert for your right solution!

It's working fine with your second advice.
Can I have one more question about this?
How can I read variable value from FormView screen? If I want to read variable value from lblTicketID in following codes, how can I change it?

Thanks again,

============== My FormView codes ================
    <asp:FormView ID="fvTicket" runat="server" DataKeyNames="TicketID" DataSourceID="sdsTicketByID" DefaultMode="Edit">
        <EditItemTemplate>
            <table>
                 <tr>
                    <td style="width: 100px">
            TicketID:</td>
                    <td style="width: 100px">
            <asp:Label ID="lblTicketID" runat="server" Text='<%# Eval("TicketID") %>'></asp:Label></td>
0
 
LVL 10

Accepted Solution

by:
Dxpert earned 200 total points
ID: 21830649
I don't quite understand your question.
Are you trying to read the ID value from the querystring and place it in the TEXT of the lblTicketID label???

<asp:Label ID="lblTicketID" runat="server" Text='<%=request.QueryString("ID")%>'></asp:Label>
0
 

Author Comment

by:Takeoutdinner
ID: 21830775
Hi Dexpert,

I would like to use like this way:

<input onclick="window.open('StockPress.aspx?ID=<%response.write(fvTicket.lblTicketID)%>','','width=980,height=300');" type="button" value="STOCK" style="width: 156px" /></td>
 
My variable value is idiplayed in FormView fvTicket>Label lblTicketID.
(Of course I stored to pubVars.pubTicketID also. This is working fine with your second advice)

Thanks for your kind help.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question