Hello sir,
I have problem in getting values of textbox which in .ascx file (user control). at aspx file(the file at which control is added).
code is as below.
code in .ascx file
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="attachfile.ascx.cs" Inherits="attachfile" %>
<asp:TextBox ID="TextBox1" runat="server" meta:resourcekey="TextBox1Resource1"></asp:TextBox>
<br />
code in .ascx.cs file
using System;
using System.IO;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class attachfile : System.Web.UI.UserControl
{
public string topicTital;
protected void Page_Load(object sender, EventArgs e)
{
}
}
code in aspx file
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="attachfileindir.aspx.cs" Inherits="attachfile" %>
<%@ Register src="attachfile.ascx" tagname="attachfile" tagprefix="uc1" %>
<head></head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<form id="form1" runat="server">
<br />
<div>
<br />
<uc1:attachfile ID="attachfile1" runat="server" />
<br />
<br />
</div>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</form>
</body>
</html>
code in aspx.cs file
public partial class attachfile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
// i want to strore that textbox value here..so how.....?
}
plz help someone.. .