473,411 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

how to transfer a dataset and a string from page to user control

Hi all
I have to transfer a dataset and a string from a webform to a user
control on the page without using viewstate or session or cookies .
properties method is not working properly. if anybody thinks that is
fine so plz describe me and send me any article or example for that.

How can i do that

Plz send any article if any body have regarding this
plz Also cc to Mu****@efextra.com
Thx in advance

Mukesh
Mu****@efextra.com
Jun 24 '06 #1
3 1542
In my understanding you have a custom control or user control that
you've placed in a webform. Now, in the webform you have a dataset or
any data that you want to give it back to the control for processing
it.

The best way to do this is to use properties in the control and assign
the dataset from the webform when ever you want to process it.

This is the straight forward way for this issue.

If you tried the same and got failed in any case, try post some code
with a breif explanation about how your're doing it.

Vadivel Kumar
http://www.vadivelk.net

Mukesh wrote:
Hi all
I have to transfer a dataset and a string from a webform to a user
control on the page without using viewstate or session or cookies .
properties method is not working properly. if anybody thinks that is
fine so plz describe me and send me any article or example for that.

How can i do that

Plz send any article if any body have regarding this
plz Also cc to Mu****@efextra.com
Thx in advance

Mukesh
Mu****@efextra.com


Jun 24 '06 #2
Vadivel Kumar wrote:
In my understanding you have a custom control or user control that
you've placed in a webform. Now, in the webform you have a dataset or
any data that you want to give it back to the control for processing
it.

The best way to do this is to use properties in the control and assign
the dataset from the webform when ever you want to process it. this is my example




This is the straight forward way for this issue.

If you tried the same and got failed in any case, try post some code
with a breif explanation about how your're doing it.

Vadivel Kumar
http://www.vadivelk.net

Mukesh wrote:
Hi all
I have to transfer a dataset and a string from a webform to a user
control on the page without using viewstate or session or cookies .
properties method is not working properly. if anybody thinks that is
fine so plz describe me and send me any article or example for that.

How can i do that

Plz send any article if any body have regarding this
plz Also cc to Mu****@efextra.com
Thx in advance

Mukesh
Mu****@efextra.com

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace property
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.UserControl Test1;
public DataSet ds = new DataSet();
public string qw;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
string select ="select * from PropertyDisplay2";
Database db = DatabaseFactory.CreateDatabase();
DBCommandWrapper cmd = db.GetSqlStringCommandWrapper(select);

db.LoadDataSet(cmd,ds,"Results");
qw="jnbdfgkdfjsgh";
Controls.test mk = new Controls.test();
// mk.Mystr="mukesh agarwal";


// Test1.FindControl("DataGrid1").DataBind();
// property.Controls.test mk = new property.Controls.test();
// mk.i=125;
//
// Label lblbvl= (Label)Test1.FindControl("Label1");
// lblbvl.Text= "rjhgkjfdhgkfdjg";
// mk.MyNumber= 321321;

}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void dataView1_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
{

}
}
}

namespace property.Controls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for test.
/// </summary>
public class test : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Label Label1;
string i;
public string Mystr
{
get
{
return i;
}
set
{
i = value;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Label1.Text += Mystr;
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}

Jun 24 '06 #3
Hi Mukesh,

My colleague Walter Wang [MSFT] has replied you in
microsoft.public.dotnet.framework.aspnet newsgroup, please check and follow
up there. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for...
0
by: Moheb Missaghi | last post by:
Hi: I am trying to use the Transfer statement in an .aspx file to redirect and send Form and QueryString collections to a different page. A good example where this is needed is a checkout page...
5
by: Jason | last post by:
I am having problems understanding how to access a datasource only once, fill a single dataset, and then reference that dataset multiple times through different user controls(ascx) found on the...
1
by: yma | last post by:
Hi, I tried to use a listbox to display a column in MS Access 2000 nwind.mdb by using ole DataAdapter, Connection and dataset controls. But I got "It is already opened exclusively by another...
5
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user...
2
by: Pete | last post by:
Hi all... I sincerly hope one of the MS guys can clear this up for me... First some background... Ok, I have a web site which is fully translatable into several languages. All the strings...
4
by: Brian | last post by:
Hi, I'm trying to make an online FTP utility in C# ASP.NET using MSINET.ocx (an active X control a.k.a. "Microsoft Internet Transfer Control") I've added the reference into my project and have...
7
by: Mukesh | last post by:
Hi all I have to transfer a dataset and a string from a webform to a user control on the page without using viewstate or session or cookies . properties method is not working properly. if...
0
by: daokfella | last post by:
I have a Login.aspx page that takes care of all my login procedures (validation, lockouts, password change requirements, password retrieval, etc.) It works like a charm. However, now I'd like a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.