Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to add window form in HTML page in asp.net
Posted
Updated 13-Feb-12 20:23pm
v2
Comments
Varun Sareen 14-Feb-12 1:10am    
What is the requirement? why you need that?
somendra chaudhary 14-Feb-12 1:16am    
I am building an application in which I have to add textboxes at the runtime
and save the value of textboxes into database.
but I have a problem that after postback all values are demolished.
how will I hold these value after postback?
Varun Sareen 14-Feb-12 2:32am    
Before postback store those values in session variable and then save them into the database. Why to include a window form for that.

If still you have some query then please you are welcome

try this,
C#
<iframe height="" width ="" src="fullpath/form.exe"></iframe>
 
Share this answer
 
v3
Hi,


Try this if could help...
Save this in App_Code
Example:
C#
public static class SessionManager
{
    private const string USER_NAME = "UserName";
    public static string UserName
    {
        get
        {
            if (HttpContext.Current.Session[USER_NAME] == null)
            {
                return string.Empty;
            }
            else
            {
                return HttpContext.Current.Session[USER_NAME].ToString();
            }
        }
        set
        {
            HttpContext.Current.Session[USER_NAME] = value;
        }
    }
}


Example: Storing value...
C#
SessionManager.UserName = "My Name";


Example: Retrieving value to next page:
C#
string userName = SessionManager.UserName.ToString();


Happy coding...
 
Share this answer
 
v2

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