Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do i retrieve a textbox value from my main page & use that value for a quiz on another page?
The main page is where the students enter their current aggregate.
Posted
Updated 28-Dec-11 16:33pm
v4
Comments
Sergey Alexandrovich Kryukov 28-Dec-11 21:14pm    
Do you think that is you are not using Visual Studio (it is not a must), the answer will be different? :-)
--SA
Sergey Alexandrovich Kryukov 28-Dec-11 21:15pm    
"Main page"... is it ASP.NET or something else? Tag it! Use "Improve question".
--SA
zenwalker1985 28-Dec-11 22:33pm    
Guessing the page here means ASP.NET, then tagged appropriately for you.
zenwalker1985 28-Dec-11 22:35pm    
I guess to make both different isolated web page talk to each other directly (Student bio vs Quiz) would lead to a tight coupling. So rather make it independent. Let the saved value go to server or an intermediate service or entity. Such a way you can have a loose coupling.

Similar question with answers
Post Data in asp.net with out using query string[^]
 
Share this answer
 
Use QueryString or Sessions

http://www.dotnetperls.com/querystring[^]
 
Share this answer
 
One more approach you can send using hidden variable.

Take one hidden variable on master page

C#
<input type="hidden" id="textvalue" name="textvalue" />


and you page
C#
<asp:textbox id="TextBox1" xmlns:asp="#unknown">
                runat="server"></asp:textbox>
        <asp:textbox id="TextBox2" xmlns:asp="#unknown">
                runat="server" style="width: 128px"></asp:textbox>
        <asp:button id="Button1" runat="server" text="Button" onclick="Button1_Click" onclientclick="storehidden" xmlns:asp="#unknown" />

<script type="text/javascript">
    function storehidden() {
        document.getElementById('textvalue').value = document.getElementById('TextBox1').value;
    }
</script>


in second page you will get the value using Request["textvalue"]

The value also wont able to see in url.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900