|
Hi Sarfaraj
Are you getting Customer info from data base then put your custId in session and retrive the value from seesion in next page then call the database for getting his Info using that custID or
If you want to access database only once then create a class (datacontainer )in which you should have all private varibles and public properties of customer Info Pupulate this value once then you can use throught the session
|
|
|
|
|
Hi Sandeep
Thanks for your Email, Could you please send me an Example. Im getting Customer Information from Database.
Sarfarj Ahmed
|
|
|
|
|
Do you need to show the data many other page of this costomer ? please reply me so that i can try to give you best solution
|
|
|
|
|
Hi Sandeep
Thanks for ur mail. Yes I need show this CustID on many other page.
Thanks
Sarfarj Ahmed
|
|
|
|
|
Hi Sarfaraj
Do one thing when you are getting CustId from the user call all the info from database which you need in other pages also. So i will better to call one once to database and store them on one object of datacontainer i.e
create one class having private varibles and public properties ........
these varaibles will contain your customer info like
private string _custName
public string CustName
{
set
{ _custName=value; }
get
{ return _custName; }
}
i think this is better way to store values if you want to store more than one custmer info then create collection(list) of that object. i think this will help you
|
|
|
|
|
i defin a dataset in the clase and fill it in page_Load
internal DataSet DSInfo = new DataSet ();
protected static void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Departments GetAllDepartments = new Departments();
DSInfo = GetAllDepartments.DepartmentsInfo();
DDL_Departments.DataSource = DSInfo.Tables[0];
DDL_Departments.DataTextField = "Name";
DDL_Departments.DataValueField = "DepartmentID";
DDL_Departments.DataBind();
}
else
{
}
}
when the page bostback=true
i lose the data in dataset
and i use the dataset in another method
how can i save the data in dataset even bostback=true
thanks for help
MD_NADA
|
|
|
|
|
You need to store the DataSet inside a state object, simple declaring it as a variable won't persist it accross post backs. ViewState is the obvious one but will probably add a lot of data to the page download so Session might be a better option.
|
|
|
|
|
declare your dataset outside the pageload event.
i.e. under public class webform1:system.web.ui.page
you would find protected .......
protected......
DataSet ..... [no need internal by default its public]
make your pageload event as private void instead protected static.... as static would be executed onle that is when the class is loaded.
Try!!!
Gautham
|
|
|
|
|
HI
Best ways from my point of view is to declare datacontainer which will hold all your data from one page to other i.e declare one class having all varibles with their public properties
|
|
|
|
|
using session, or cache...
<< >>
|
|
|
|
|
I have developed a website. If i use Internet 7.0 , i am able to open multiple instances of the application and my session variables are getting mixed up. Some one told me that i can Use GUID. Is there any other better method. If i have to use GUID. How to use GUID?
Plz help me
Mads
|
|
|
|
|
It's not very likely that the session variables gets mixed up, it's more likely that you mix up which session each window belongs to.
I haven't yet tested exactly how IE 7 handles browser sessions. I know that using IE 6 you can open separate instances of the browser, and each instance is it's own session. You can open several windows from each instance, and each window in one instance belongs to the same session.
Using firefox you can only open one instance (trying to open another will open a new window in the same instance), so all windows will be in the same session.
The session id is stored as a temporary cookie in the browser instance. You can display the Session.SessionID value in the page during testing, so that you can track what session each window belongs to.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
I made an application in ASP.net 2.0 with c#.
My problem is:-
I have created one WebUserControl.ascx and this WebUserControl.ascx contains one dropdown list.In dropdownlist I have added five items like 1,2,3,4 and 5.
Then, I create on Default.aspx which contains
<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>
<title>Untitled Page
<uc1:webusercontrol id="WebUserControl1" runat="server">
<asp:checkbox id="CheckBox1" runat="server" autopostback="True">
<uc1:webusercontrol id="WebUserControl2" runat="server">
WebUserControl :-
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<asp:dropdownlist id="DropDownList1" runat="server">
<asp:listitem>1
<asp:listitem>2
<asp:listitem>3
<asp:listitem>4
<asp:listitem>5
Now I would like to do when checkbox1 is true then
Select Index of DropDownList1 in WebUserControl2 should be 2.
I mean to say, how we can envoke or call event on Select of CheckBox1 ?
rajesh
|
|
|
|
|
Try accessing the dropdown using the properties.
public returntype propertyname
{
get{return dropdown1.selectedindex}
set{dropdown1.selectedindex=value}
}
so, while you are using checkboxes try to change this property!!
Just an idea not sure whether it would work or not?
Gautham
|
|
|
|
|
Write it in user control itself you can public property in user control
|
|
|
|
|
Hi
can anybody please let me know the regular expression the below scenario
1. Password should contain minimum of 6 characterss
2. Password should be alpha numeric
3. Password should contain atleast 2 numbers and 4 characters
4. Password shouldnot contain any special character
Thanks a lot in Advance
Thanks and Regards
Venkat
|
|
|
|
|
1 and 2 are simple (and 4 is covered by 2):
^[A-Za-z0-9]{6,}$
3 can perhaps be solved by adding a pair of zero-length lookaheads:
^(?=(.*\d){2})(?=(.*[A-Za-z]){4})[A-Za-z0-9]{6,}$
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I want to get only the Date part from the DateTime Field. I dont want the time to be displayed along with the date. How to get it?
I am using VB.net and it's a windows application.
My code is :
Dim grdToDate As String = currentRow.Cells(4).Value
Dim gridToDate As String = Format(currentRow.Cells(4).Value, "mm/dd/yyyy")
Dim AMCFrmDt As String = Format(AMCFromDate.Value, "mm/dd/yyyy")
But it is not giving methe proper result.
Thanks,
Riz
|
|
|
|
|
Check for any method like Date, grdToDate.Date???
Gautham
|
|
|
|
|
Dear Mam,
It may work fine I guess, please try it out. And tell me yesterday u have asked for disabling back button. Which was working fine. Please let me know.
Dim dt As Date = Date.Parse("<the given Date Time string>")
Dim strDate = dt.Month & "/" & dt.Day & "/" & dt.Year
Thank you.
Regards,
Aleem,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Hi,
I believe 'mm' format Specifier is for Minute.
Try use 'MM' for month instead of 'mm'. Hopefully it gives you the right value
Regards,
Jay
|
|
|
|
|
this is in c# u convertthis into vb and try this will work,
string s=myDT.ToString("dd")
if u have msdn in ur pc look for "DateTimeFormatInfo Class"
|
|
|
|
|
Iam searching for an online exam code using c#.NET or ASP.NET and this application read Questions randomly from a list of questions Stored in database like MSSQL2000
PLZ any one can help me to find this application because I Know this type of application available and done by professional programers like members of this Forum
|
|
|
|
|
Its not one or couple lines of code you will have to divide it into different tiers Such UI,Bussiness and Datbase -
Start from Scraching means collect all information then decide what you want then start from DataBAse or UI ?
|
|
|
|
|
No need to start new thread about the very same topic. There is modify button (or you could write another post) if you think you didnt express yourself well at previous thread.
Take a look at http://www.codeproject.com/aspnet/xmlquiz.asp[^]. It's in ASP.NET 1.0 but could be helpful.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|