|
You can user Server.Transfer("page.aspx") method to pass values from one page to other page.
Create a collection property in PageA which contains all the values you want to pass, and access the property in the PageB.aspx, but remember that use Server.Transfer insted of Response.Redirect method and EnableViewStateMac page directive value should be false, other wise you'll get error.
Regards
Prakash
|
|
|
|
|
HI
Instead of creating in the page you can have seperate class called DataCintainer class which will have all Private varuables and public properties containing your data so that you can access from Anywhere Only you need to assign values before going to second page
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Thanks Sandeep,
can you provide me sort of example??
Gautham
|
|
|
|
|
private string _CategoryId = "";
public string CategoryId
{
get { return this._CategoryId; }
set { this._CategoryId = value; }
}
private string _CategoryName = "No Group";
public string CategoryName
{
get { return this._CategoryName; }
set { this._CategoryName = value; }
}
private int _CategoryState = 0;
public int CategoryState
{
get { return this._CategoryState; }
set { this._CategoryState = value; }
}
private string _AccountNumber = "";
public string AccountNumber
{
get { return this._AccountNumber; }
set { this._AccountNumber = value; }
}
private string _AccountType = "";
public string AccountType
{
get{ return this._AccountType;}
set{ this._AccountType = value;}
}
private string _RoutingNumber = "";
public string RoutingNumber
{
get{ return this._RoutingNumber;}
set{ this._RoutingNumber = value;}
}
private System.DateTime _LastCollectionDate;
public System.DateTime LastCollectionDate
{
get { return this._LastCollectionDate; }
set { this._LastCollectionDate = value; }
}
private bool _HasPendingCollections;
public bool HasPendingCollections
{
get{ return this._HasPendingCollections;}
set{ this._HasPendingCollections = value;}
}
private bool _ShowActionLinks = false;
public bool ShowActionLinks
{
get{return _ShowActionLinks;}
set{_ShowActionLinks = value;}
}
private string _BankName = "";
public string BankName
{
get { return this._BankName; }
set { this._BankName = value; }
}
this is container class with public properties and private varaibles
create a object of this class and pass this object to the page where you want to show/use tha data
example from page 1 to page 2
InSubmitstep of page1
this.PropertyOfPage2.pupulateData(this.DataContainerObject);
i think it is effective if you have large data and pages ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Hi Sandeep, to store object of DataCintainer class which you have specified we need to do some state management which he don't want to use. I hope you agree with me on this point.
Regards
Prakash
|
|
|
|
|
Ya state manegement is required for that concept OK Boss
you have given right solution then
<l>Thanks and Regards
Sandeep
|
|
|
|
|
hi can you help me with this?..
i have
in my class table--
classcode nvarchar,
teacher nvarchar,
room nvarchar,
TimeStart dateTime,
TimeEnd dateTime,
in my input for example--
class1 teacher1 room1 Feb-02-2007 8:00:00 AM Feb-02-2007 18:00:00 PM
If another class will be inserted it should not be in between the timestart and the timeEnd or else shows some error.The teacher should have training after the timeEnd and the room should be occupied after the training.
this input shoud not be accepted---
class2 teacher2 room1 Feb-02-2007 9:00:00 AM Feb-02-2007 18:00:00 PM
thank you very much....
Bernie
|
|
|
|
|
HI
Are you doing the console application ?
Are you passing all your data to database i.e What are you using for storing perpose ? and i am confused about your requirement What you want actually?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
i am using asp.net web express, i want in my program to CHECK constraints,
For example..
The teacher has training from JAN-02-2007 8:00:00 AM - JAN-02-2007 18:00:00 PM,
The teacher must not have training between the time given. He can have traning if the EndTime was finish..
Can you show me sample CONSTRAINTS CHECK?
Bernie
|
|
|
|
|
You can use query string to send multiple values and these values may be encrypted from the source page. These will be decrypted on the target page. This, i think, would be a simple solution.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hey Cool
Suppose i have many pages and have to flows between those then i need to make encryption and vice versa every time ? is it right
<l>Thanks and Regards
Sandeep
|
|
|
|
|
You can put the encryption and decryption logic in a class and use those static methods from anywhere in your site. Not a great deal, i guess.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
example code or reference site??
Gautham
|
|
|
|
|
|
No clue whatsoever you are talking about???
Gautham
|
|
|
|
|
To Whom you replied Gautham ..To me?
Ok let me explain...
Just think a scenario that i want to export data from a Dataset to Excel file.
Am using XMLTextWriter to write into the file stream from the dataset.
So if i want to format the columns of the excel,like making the first row data alone as bold letters,coming from XML file, how can i do it?
The code am using is
for(int j=0;j<xHeader.Length;j++)
{<br />
writer.WriteString("\"");<br />
writer.WriteStartElement("xsl:value-of");<br />
writer.WriteAttributeString("select", "'" + xHeader[j] + "'");<br />
writer.WriteEndElement();
writer.WriteString("\"");<br />
if (j != xFields.Length - 1) <br />
writer.WriteString(" ");<br />
<br />
}
Can you get my point now?
|
|
|
|
|
Hi guys,
Am trying to export some data to Excel file
I can succeed in exporting the data but i couldnt format the headers and data.For example,
<br />
<Styles><br />
<Style ss:ID="s21"><br />
<Font ss:Bold="1"/><br />
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/><br />
</Style><br />
</Styles><br />
if i want to include this formatting using XMLTextWriter, how can i do that?
Am using the following code to export the data:
<br />
<br />
for(int j=0;j<xHeader.Length;j++)
{<br />
writer.WriteString("\"");<br />
writer.WriteStartElement("xsl:value-of");<br />
writer.WriteAttributeString("select", "'" + xHeader[j] + "'");<br />
writer.WriteEndElement();
writer.WriteString("\"");<br />
if (j != xFields.Length - 1) <br />
writer.WriteString(" ");<br />
} <br />
I need to format this xHeader's value to be formatted as "Bold" while opening as Excel.
Please help me!
|
|
|
|
|
It seems that you are writing Xml file rather than Excel file
<l>Thanks and Regards
Sandeep
|
|
|
|
|
hi
i'm doing a project on travel & tourism in asp.net..am using oracle as the backend...so far i've created 3 tables :
1.customer table which contains all the usernames & passwords
2.package table which contains the different packages my website provides..this table consists of the package no,package name & its cost...am dealing with only 5 packages...
3.bookings table which contains almost all details i've provided in d webform like credit card no,status,date of journey,bookings date,package no etc...
for checking out the ticket availability say me if this wud work out:
like comparing the booking date & date of journey, checking if booking date is 1month before the date of journey, 1/2month before or not?? if 1 month means tickets r available,1/2 month means only half the seats r available..is it possible to compare dates????
waiting for some1 to reply & help me out pls...
|
|
|
|
|
hai
this is a sample code. check whether this wld help to solve ur prob.
Dim t1 As New DateTime(100)
Dim t2 As New DateTime(20)
If DateTime.Compare(t1, t2) > 0 Then
Console.WriteLine("t1 > t2")
End If
If DateTime.Compare(t1, t2) = 0 Then
Console.WriteLine("t1 == t2")
End If
If DateTime.Compare(t1, t2) < 0 Then
Console.WriteLine("t1 < t2")
End If
|
|
|
|
|
Ofcourse you can compare two dates Ishwarya!
Now, lets say the dateofjourney is more than 30 days then display a message like 'Booking Not Open'.
If the dateofjourney is less than 30 days then you do your calculations like say from Hyderabad to bangalore on 18th Feb there are 30 tickets available and custmer wants 5 tickets then you have to do 30-5.
so this way the tickets availabilty would be changed.....
basic idea!!!
Gautham
|
|
|
|
|
Hi All,
I have an Intranet built on Java and JSP pages, and I have an ASP file (default.aspx) which I need to open it inside this Intranet.
The problem that this file does not open correctly here, it onle shows the texts and does not show items like buttons. I don't know if there is a solution for this problem or not.
note: the ASP file is working correctly and does not have a problem if you open it inside a browser alone.
Kind Regards
OBarahmeh
Palestinian Central Bureau of Statistics (PCBS)
Ramallah-Palestinian Territory
|
|
|
|
|
Are you saying you're trying to get Tomcat to run the file for you? It can't, its a Servlet container - as in Java?! The aspx file needs to be run through IIS on a machine with the .NET framework installed.
|
|
|
|
|
Quite new to this
Open Visual Studio .NET 2003
Select "New Project"
Selact "ASP .NET Web Application", give it a name
receive error:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'WebApplication1.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="WebApplication1.Global" %>
Where did I go wrong?
|
|
|
|
|
This error occurs when you create a new web application in asp.net using visual studio.net and without compiling the application, you try to browse a page in the application.
This occurs because of the Application DLL not having been formed.
asp.net will look in the Global Assembly Cache, and then in the application's local bin directory. If it can't find the class with the name you specified then it won't load. When you do a codebehind file in Visual studio, you are writing a base class for your aspx file to inherit from - the HTML template you write in the aspx is inlined into the dynamically generated subclass's Render method.
Even if you don't put any code in your page, you still need to compile it as long as you put the Inherts Webappname.Global in your Page directive.
To resolve this, Built the application using Ctrl + Shift + B or use F5 to build the application and then try to browse the application. The error will be resolved.
Gautham
|
|
|
|