473,395 Members | 1,647 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,395 software developers and data experts.

c# and webforms

Ok I'm learning C#, I' trying to do a ASP.NET page where a user key a date
range, now I want it to call a different asp.net c# page that will proces
that request passing the parameters.

What I have done so far is the main page were he user type the date range,
I'll using all webform control, now I have a buton that has the following
code:

private void Button1_Click(object sender, System.EventArgs e)
{
if (Calendar2.SelectedDate < Calendar1.SelectedDate)
{
LabelErr.Text = "Please check your dates, the FROM date can be
earlier than the TO date";
}
else
{
LabelErr.Text = "Processing ... please wait";
scaleresult Myscaleresult = new scaleresult();
// WHAT SHOULD I WRITE HERE
}
}

What should I write to call a resilts.aspc page assing the date parameters.
?

Thanks

Carlos


Nov 15 '05 #1
3 2354
Carlos,

Instead of calling another ASPX page, you should take the functionality
that is in the page and place it in a class on it's own. Once you have
that, you can create an instance of the object and then call the method like
you would any other object.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Carlos" <cp****@yahoo.com> wrote in message
news:eb****************@tk2msftngp13.phx.gbl...
Ok I'm learning C#, I' trying to do a ASP.NET page where a user key a date
range, now I want it to call a different asp.net c# page that will proces
that request passing the parameters.

What I have done so far is the main page were he user type the date range,
I'll using all webform control, now I have a buton that has the following
code:

private void Button1_Click(object sender, System.EventArgs e)
{
if (Calendar2.SelectedDate < Calendar1.SelectedDate)
{
LabelErr.Text = "Please check your dates, the FROM date can be
earlier than the TO date";
}
else
{
LabelErr.Text = "Processing ... please wait";
scaleresult Myscaleresult = new scaleresult();
// WHAT SHOULD I WRITE HERE
}
}

What should I write to call a resilts.aspc page assing the date parameters. ?

Thanks

Carlos

Nov 15 '05 #2
So are you saying that I create a class to handle the code that is in the
result.aspx ?

and if that is the chase how do a erase all control that I have in
Default.aspx to write the result of the queries on the page ?

Carlos
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@tk2msftngp13.phx.gbl...
Carlos,

Instead of calling another ASPX page, you should take the functionality that is in the page and place it in a class on it's own. Once you have
that, you can create an instance of the object and then call the method like you would any other object.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Carlos" <cp****@yahoo.com> wrote in message
news:eb****************@tk2msftngp13.phx.gbl...
Ok I'm learning C#, I' trying to do a ASP.NET page where a user key a date range, now I want it to call a different asp.net c# page that will proces that request passing the parameters.

What I have done so far is the main page were he user type the date range, I'll using all webform control, now I have a buton that has the following code:

private void Button1_Click(object sender, System.EventArgs e)
{
if (Calendar2.SelectedDate < Calendar1.SelectedDate)
{
LabelErr.Text = "Please check your dates, the FROM date can be
earlier than the TO date";
}
else
{
LabelErr.Text = "Processing ... please wait";
scaleresult Myscaleresult = new scaleresult();
// WHAT SHOULD I WRITE HERE
}
}

What should I write to call a resilts.aspc page assing the date

parameters.
?

Thanks

Carlos


Nov 15 '05 #3
Hi,

To pass values between webforms, have a look at the
following link...

http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/vbcon/html/vbtskpassingvaluesbetweenwebformspages.asp

Hope this helps..

Regards,
Madhu

MVP | MCSD.NET
-----Original Message-----
Ok I'm learning C#, I' trying to do a ASP.NET page where a user key a daterange, now I want it to call a different asp.net c# page that will procesthat request passing the parameters.

What I have done so far is the main page were he user type the date range,I'll using all webform control, now I have a buton that has the followingcode:

private void Button1_Click(object sender, System.EventArgs e) {
if (Calendar2.SelectedDate < Calendar1.SelectedDate) {
LabelErr.Text = "Please check your dates, the FROM date can beearlier than the TO date";
}
else
{
LabelErr.Text = "Processing ... please wait";
scaleresult Myscaleresult = new scaleresult (); // WHAT SHOULD I WRITE HERE
}
}

What should I write to call a resilts.aspc page assing the date parameters.?

Thanks

Carlos


.

Nov 15 '05 #4

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

Similar topics

3
by: rachel | last post by:
Hi all, I am new in ASP.Net. I have a question on link multiple web forms together. Here is the scenario: I create an Index.aspx WebForm which consists of a banner and three navigator...
1
by: Paul R | last post by:
Hi, I have a Winforms application that access some SQLServer2000 stored procedures. I have now written some new Webforms pages to use some of the same stored procs. The Webforms use the SAME...
3
by: Netserver | last post by:
Hi have a question hope there is a simple answer. I want to enter data in to 2 arrays from several webforms in project and be able to recall that data from any of the webforms, other then using a...
3
by: | last post by:
All the fields in webforms are automatically declared as protected. If I change them to public, they are converted back to protected. Why is this happening ? Thanks
20
by: Martin Rosén-Lidholm | last post by:
Although an impossible question to answer, I fell urged to raise it anyhow. Given a fairly complex ERP application scenario, what's your estimation for the X-ratio dev. time for...
2
by: Piotr Karwatka | last post by:
Hi! I have a little problem an qeustion. In .NET Windows Forms I can do something like that: - i have forms - Form1 Form2, on first form i have TextBox1 control on 2nd form I have Button1...
0
by: Joergen Bech | last post by:
Trying to implement my own webforms designer to be hosted in a WinForms environment. Basically: I know that mshtml is used in the VS.Net 2003 WebForms designer, but the HTML behind the scenes is...
4
by: 3Cooks | last post by:
I have a windows application written in Visual Basic 6.0 that is going to be redeveloped in dotNET. We are trying to decide if we should deploy using Webforms or Winforms and I need advice from...
5
by: Bit byte | last post by:
Can I use C# (Winforms) to design a website?. I am from C/C++ background but know nothing about Internet programming. My understanding of WebForms are that they are similar to WinForms in that...
0
by: JM | last post by:
Hi, I have uploaded an application written in asp.net 2.0 on server. By web controls started giving Javascript error and I figured it out from discussion groups that I have to put WebForms.js...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.