|
I want to design a web for online shopping.I don't want to use login controls.I want to use session for users.when a user add an item to shopping cart how can i use session to save the items in shopping cart without saving in database?I don't want to use cache.I use a class for shoppingcart.when a user add item to it's shoppingcart I don't want to go to the page of the shoppingcart.
|
|
|
|
|
bbc_sh wrote: I want to use session for users.when a user add an item to shopping cart how can i use session to save the items in shopping cart without saving in database?I don't want to use cache
Okay, it says you don't have much idea about what session and cache is. BTW, keeping shopping cart items in session is not a good idea. I'd create a table something named "shopping" in the database and keep the items there which can be accessed using the session id.
Keeping items to session is trivial. Say you have a product class named "Product". Then you can keep a generic List<Product> instance in the session which represents shopping cart items. To add items,
List<Product> shoppingCart = Session["ShoppingCart"] as List<Product> ;
shoppingCart.Add(new Product());
bbc_sh wrote: I don't want to go to the page of the shoppingcart.
If you don't want to move to shopping cart page, just don't redirect after adding item.
|
|
|
|
|
If i want to use cache for shoppingcart what should i do?
|
|
|
|
|
I have a website using forms authentication. I seem to have a problem with it and I'd appreciate if you could help me on this. I use <forms timeout="600"> and <sessionState timeout="600"> in web.config. In login page I have this code:
protected void pageLogin_Authenticate(object sender, AuthenticateEventArgs e)
{
if (Membership.ValidateUser(this.pageLogin.UserName.Trim(),this.pageLogin.Password.Trim()))
{
MembershipUser u = Membership.GetUser(this.pageLogin.UserName.Trim(), false);
Session["UserId"] = u.ProviderUserKey.ToString();
e.Authenticated = true;
}
else
{
e.Authenticated = false;
}
}
protected void pageLogin_LoggedIn(object sender, EventArgs e)
{
FormsAuthentication.RedirectFromLoginPage(Session["UserId"].ToString(), false);
}
I use Session["UserId"] on other protected pages. The problem is, sometimes when I refresh a page after a short while that uses Session["UserId"] I get null reference error on Session["UserId"] line. Why it is expiring so soon, I don't have anything modifying web.config or the website so I don't think IIS is recycling. And shouldn't it redirect to login page if session is expired? Am I missing something here?
This is on WinXp sp2 and IIS6.
|
|
|
|
|
what authentication mode did you set in IIS ? if you have used forms then you should select Anonumous authentication.
cheers,
Abhijit
|
|
|
|
|
currently i m using asp.net with c# (.net 2005, 2.0 framework) and SQL SERVER database.
Here i launched my project in server and data will be fetched and processed by users.
Here i want to protect records and it should not fetched by more than one person.
For example..
if the record "1" has been taken by a user, then it should be locked and no other user should fetch it (a message should be prompt).After the completion of work and if the user release it (finished processed and save/cancel) then it can be accessed by others..
how to implement it...
help me. thanks in advace - KARAN
|
|
|
|
|
|
thanks sam xavier. it help me a lot and this is what i need exactly to me.... but this is via QUERY. And is there any approach towards using in .net 2005? (C#.NET with asp.net)?
|
|
|
|
|
Hi,
I created a web application in ASP.NET 2.0 with just a label and a button. In the button click i've the code:
Label1.Text = Server.MapPath("/mapTest");
I deployed this app in a Windows 2000 Server SP4, and in my Win Xp Pro SP3. The app was deployed in D:\TestFolder\
The Label text in Win XP was:
D:\TestFolder\default.aspx
The Label text in Win 2000 SP4 Server was:
C:\Inetpub\wwwroot\TestFolder\default.aspx
Could anyone please explain why this happens?
Regards,
Blumen
|
|
|
|
|
Blumen wrote: The Label text in Win 2000 SP4 Server was:
C:\Inetpub\wwwroot\TestFolder\default.aspx
in Win 2000, did you deployed in D:\TestFolder or inetpup ?
cheers,
Abhijit
|
|
|
|
|
|
In Win 2000, Virtual Directy - > Right Click on your virtual Directory - > Propertires - > Check Local path in Virtual Directory TAB.
what is that ?
cheers,
Abhijit
|
|
|
|
|
|
In Windows XP pro the site has to be a virtual directory (as the IIS is limited to the default site), but in Windows 2000 server it could be a web site.
Have you deployed it as a site or a virtual directory on Windows 2000 server?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thank you for the reply.
Guffa wrote: In Windows XP pro the site has to be a virtual directory (as the IIS is limited to the default site), but in Windows 2000 server it could be a web site.
I din't understand the above part.
In Windows 2000, I've deployed it as a virtual directory. What would be the difference in deploying as a website?
|
|
|
|
|
when i execute the crystal report the report header section vanishes.at the design time the report header sections are covered by blue lines is there any option to enable or disable the concerned section.
how i can show report header in a crystal report
Thanks in advance
sourav ghosh
|
|
|
|
|
Example, you have report.rpt means.. open report.rpt then right click Insert->section->select report header from left side option then in right side un-check the Suppress (No Drill Down)->ok
Now you can see your report header section..
S.G. SIVA M.C.A.,
+919865943001
|
|
|
|
|
Hi all,
how i can display the multiple records of reserved vehicle in a single row
for suppose if one vehicle is reserved two times in a current date i have to display both records in a single row against vehicle name .
and in a second row i want to display records for second vehicle if it is reseerved iam usiing sql server 2000 as beckend database .
my fileds are Reserve_ID,Vehicle_Name,ReserveStarttime,ReserveEndtime ,purpose .
kindly help me in this regard iam stuck on this .
regards
Rammez
Thanks in advance
|
|
|
|
|
What have you done so far with this?
rameez Raja wrote: display the multiple records of reserved vehicle in a single row
rameez Raja wrote: in a second row i want to display records for second vehicle if it is reseerved
Sounds like you need to read up on master-details type of stuff.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi..
i want to export content of a page in which i also have a datagrid.my code is as follows:-
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.doc");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.word";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
PrintArea.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End()
file is being saved on desktop but not being opened becoz of proper format...
|
|
|
|
|
Exactly, you can't magically claim it's a Word file, if it isn't. You can send a text file, or you an interop Word to create a Word file to send.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I have created a code to export the report to excel and it works.. but when i use the export property of the crystal report viewer, all file format works except for the excel format and I am receiving this kind of message whenever I tried using export property of the crystal report viewer..
"Error in File rpt017 {4742A80B-0356-499C-9B57-BE59A69BD788}.rpt: Invalid export DLL or export format."
any idea? someone?
yours truly,
hyperalergelo
|
|
|
|
|
anyone?
yours truly,
hyperalergelo
|
|
|
|
|
i have a master page
and i added a new page and i select this master page for it
now i written a java script in the content page
which returns date and display in hiddenfield
for that i written like this
Function RetTime()
{
var a_p = "";
var d = new Date();
var curr_hour = d.getHours();
if (curr_hour < 12)
{
a_p = "AM";
}
else
{
a_p = "PM";
}
if (curr_hour == 0)
{
curr_hour = 12;
}
if (curr_hour > 12)
{
curr_hour = curr_hour - 12;
}
var curr_min = d.getMinutes();
curr_min = curr_min + "";
if (curr_min.length == 1)
{
curr_min = "0" + curr_min;
}
document.write(curr_hour + " : " + curr_min + " " + a_p);
}
but it is not working
plz help me
how can i run this function and display in hiddenfiled
or store the date in a variable of content page
i want to store todays date in database
plz help me
thanks in advance
vijay kumar
|
|
|
|
|
vijaylumar wrote: now i written a java script in the content page
which returns date and display in hiddenfield
That code doesn't even attempt to put the value in a hidden field.
vijaylumar wrote: i want to store todays date in database
Both the server side code and the database itself are capable of producing this value. Did you use this method to specifically get the time used by the client computer?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|