Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get a value from C# page to HTML text box ...........

Here is my Code:-

C# code......

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
int a = 5;

}
}

I want This Value to HTML Page at Given textBox.......

XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
First name: <input type="text" name="fname">
</body>
</html>
Posted

Firstly Send all data from QueryString after that using javascript to pickup data from URL
 
Share this answer
 
Use Public Property/Member in .cs page and Access it using <%= VariableName %> in .aspx page.

ex.//
.cs

Public String Name {get;set;}

Assign value to Name property in your code.

.aspx
XML
<body>
First name: <input type="text" name="fname" value='<%= Name %>' >
</body>
 
Share this answer
 
v2
Comments
Parmendra choudhary 18-Nov-13 0:37am    
where is we write ...........Public String Name {get;set;}

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