Click here to Skip to main content
15,912,977 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: iunno Pin
Pete O'Hanlon11-Dec-07 11:06
mvePete O'Hanlon11-Dec-07 11:06 
GeneralRe: iunno Pin
Christian Graus11-Dec-07 13:30
protectorChristian Graus11-Dec-07 13:30 
GeneralRe: iunno Pin
Pete O'Hanlon11-Dec-07 21:55
mvePete O'Hanlon11-Dec-07 21:55 
QuestionGridView on MultiView / View with MenuItems to change Views - the problem Pin
Member 470022511-Dec-07 8:01
Member 470022511-Dec-07 8:01 
GeneralRe: GridView on MultiView / View with MenuItems to change Views - the problem Pin
Michael Sync11-Dec-07 16:33
Michael Sync11-Dec-07 16:33 
AnswerRe: GridView on MultiView / View with MenuItems to change Views - the problem Pin
Member 470022511-Dec-07 19:36
Member 470022511-Dec-07 19:36 
QuestionHow to use a datagrid in a user control Pin
mastoj11-Dec-07 5:44
mastoj11-Dec-07 5:44 
GeneralRe: How to use a datagrid in a user control Pin
Michael Sync11-Dec-07 16:46
Michael Sync11-Dec-07 16:46 
mastoj wrote:
< ![CDATA


Why did you add this?


mastoj wrote:
The codebehind is empty.


The code-behind file should not be emply. (You are using ASP.NET 1x, right? )

At least, it should be something like that ~

namespace WebApplication3<br />
{<br />
	using System;<br />
	using System.Data;<br />
	using System.Drawing;<br />
	using System.Web;<br />
	using System.Web.UI.WebControls;<br />
	using System.Web.UI.HtmlControls;<br />
<br />
	/// <summary><br />
	///		Summary description for WebUserControl1.<br />
	/// </summary><br />
	public class WebUserControl1 : System.Web.UI.UserControl<br />
	{<br />
		protected System.Web.UI.WebControls.DataGrid DataGrid1;<br />
<br />
		private void Page_Load(object sender, System.EventArgs e)<br />
		{<br />
			// Put user code to initialize the page here<br />
		}<br />
<br />
		#region Web Form Designer generated code<br />
		override protected void OnInit(EventArgs e)<br />
		{<br />
			//<br />
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.<br />
			//<br />
			InitializeComponent();<br />
			base.OnInit(e);<br />
		}<br />
		<br />
		/// <summary><br />
		///		Required method for Designer support - do not modify<br />
		///		the contents of this method with the code editor.<br />
		/// </summary><br />
		private void InitializeComponent()<br />
		{<br />
			this.Load += new System.EventHandler(this.Page_Load);<br />
<br />
		}<br />
		#endregion<br />
	}<br />
}<br />


I think there are some wrongs in creating the user control. How did you create your usercontrol? What you should do is that just add the Web User Control in your project. Then, add the DataGrid to your user control. that's all you need.


mastoj wrote:
I register the control in the web.config


Why do you need that?

Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)


GeneralRe: How to use a datagrid in a user control Pin
mastoj11-Dec-07 19:23
mastoj11-Dec-07 19:23 
GeneralRe: How to use a datagrid in a user control Pin
Michael Sync11-Dec-07 19:42
Michael Sync11-Dec-07 19:42 
GeneralRe: How to use a datagrid in a user control Pin
mastoj11-Dec-07 20:00
mastoj11-Dec-07 20:00 
GeneralRe: How to use a datagrid in a user control Pin
Michael Sync11-Dec-07 20:09
Michael Sync11-Dec-07 20:09 
QuestionLinkbutton Accesskey Pin
vincyjinoy11-Dec-07 4:54
vincyjinoy11-Dec-07 4:54 
GeneralRe: Linkbutton Accesskey Pin
Michael Sync11-Dec-07 16:42
Michael Sync11-Dec-07 16:42 
GeneralInternet Explorer needs to resend the information you've previously submitted Pin
samerh11-Dec-07 3:32
samerh11-Dec-07 3:32 
GeneralRe: Internet Explorer needs to resend the information you've previously submitted Pin
Michael Sync11-Dec-07 16:52
Michael Sync11-Dec-07 16:52 
GeneralRe: Internet Explorer needs to resend the information you've previously submitted Pin
samerh11-Dec-07 19:04
samerh11-Dec-07 19:04 
GeneralRe: Internet Explorer needs to resend the information you've previously submitted Pin
Michael Sync11-Dec-07 19:50
Michael Sync11-Dec-07 19:50 
GeneralRe: Internet Explorer needs to resend the information you've previously submitted Pin
samerh11-Dec-07 20:05
samerh11-Dec-07 20:05 
QuestionHow To Call C# Function From JavaScript Pin
mrgaddam11-Dec-07 3:13
mrgaddam11-Dec-07 3:13 
AnswerRe: How To Call C# Function From JavaScript Pin
RichardGrimmer11-Dec-07 5:17
RichardGrimmer11-Dec-07 5:17 
GeneralRe: How To Call C# Function From JavaScript Pin
YeHtut11-Dec-07 16:24
YeHtut11-Dec-07 16:24 
GeneralRe: How To Call C# Function From JavaScript Pin
Michael Sync11-Dec-07 17:08
Michael Sync11-Dec-07 17:08 
AnswerRe: How To Call C# Function From JavaScript Pin
Sun Rays11-Dec-07 18:47
Sun Rays11-Dec-07 18:47 
AnswerRe: How To Call C# Function From JavaScript Pin
YeHtut11-Dec-07 19:44
YeHtut11-Dec-07 19:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.