Solved

ASP.NET Pop Up Screen with QueryString

Posted on 2008-06-19
5
447 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now