Solved

ASP.NET Pop Up Screen with QueryString

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 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