Ascx user control, define a property to receive parameters
Example:
private string Mbooktitle;
public string Booktite
{
Get{return Mboktitle;}
Set{mbooktitle=value;}
}
Calling this property in an ASPX page can
protected Usercontrol.bookseach Mbookseach;
Set the pass value
Mbookseach.booktitle=txtbooktitle.value;
User Control Xxx.ascx:
<%@ control language= "C #"%>
Html...
<script runat= "Server" >
public string backclo = "Red"; This defines a parameter
public void Page_Load ()
{ }
</script>
To call this variable in aspx, you can:
<%@ Register tagprefix= "UserControl" tagname= "Webbott" src= "Xxx.ascx"%>
<body>
<form runat= "Server" method= "POST" >
<usercontrol:webbott id= "Mybott" runat= "Server"/>
</form>
</body>
<script language= "C #" runat= "Server" >
public void Page_Load ()
{
String Newclo = "BLACK";
Mybott. Backclo = Newclo; Changed the argument in ascx!
}
</script>