Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP.NET Pop Up Screen with QueryString

Posted on 2008-06-19
5
Medium Priority
?
469 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

972 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