Solved

ASP.NET Pop Up Screen with QueryString

Posted on 2008-06-19
5
451 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 50 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Gridview selected row 9 47
imap mails 1 23
Help with exporting to excel 4 28
Linq asp.net mvc 13 10
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:…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

810 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