|
I have a Product Order page. A user can order many products. To simplify it, user can just type the word "beer" into a textbox and click on ADD button, cookies and click on ADD button again, socks and click on ADD button again into a database. So, a database will show:
UserID
UserName
OrderID
Product List (Beer, Cookies, Socks)
After the user decides on the list of things to buy. Then the user click on SAVE, to save that record (with multiple items) to another database.
Very much like ADD TO CART concept. Anyone can guide me with this? How should I go about it?
There are a lot of people who ended up doing things wrongly, even if they had the best of intentions at the beginning. Then again, there is no guarantee the words they said were conveyed as they originally were intended to be. That's because those on the receiving end only hear what they want to hear.
|
|
|
|
|
What I have is a web page, that allows you to select 1 of 12 possible options. When one of these 12 options are selected I want the web form that it loads to dynamically choose a flash movie file based on the selection.
Here is my code in HTML
<code><OBJECT id="Banner" style="Z-INDEX: 147; LEFT: 93px; POSITION: absolute; TOP: 158px" codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" height="100" width="748" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" VIEWASTEXT>
<PARAMNAME="_cx" VALUE="19791">
<PARAM NAME="_cy" VALUE="2646">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="Banner.swf">
<PARAM NAME="Src" VALUE="Banner.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="sameDomain">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="FFFFFF">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<PARAM NAME="Profile" VALUE="0">
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<embed src="Banner.swf" width="748" height="100" align="middle" />
</OBJECT></code>
***************************************************
Now as you can see..."<embed src="Banner.swf"....
.<PARAM NAME="Movie" VALUE="Banner.swf">..
...<PARAM NAME="Src" VALUE="Banner.swf">.
...<OBJECT id="Banner"....."
These are all pointing at "BANNER.SWF"....but in code I would like to dynamically change those tags to "BANNER2.SWF", "BANNER3.SWF"...etc etc based on the users choice.
I have tried using the "HtmlGenericControl" to try and change these during run time but not sucessfully.
Any help would be appreciated.
-- modified at 19:20 Sunday 23rd April, 2006
|
|
|
|
|
IMO, there are two options which you may consider using to dynamically change the media file.
+ Use the client side script, you can get reference to the player(for example with the getElementById method), then change the Src property of the player.
+ Use the server side script, you will re-render the player with the new html markup which contains a new media file for the src parameter.
|
|
|
|
|
Can we replace Customer control instead of user control?
|
|
|
|
|
did you mean custom controls ?
|
|
|
|
|
Assuming you mean the custom control, then yes you can use the custom control in lieu of the web user control. However depending on your context, using custom control or user control should be easier, you can see the recommendation in MSDN[^].
|
|
|
|
|
Both has its own advantages
We can use either but it all depends on our requirement
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
I haven't done much ASP.Net so I hope this is a small problem:
I have a page where the users can log in to the website. Their role depends on what page they get redirected to, so I am handeling the LoggedIn event of the Login control:
protected void Login_LoggedIn(object sender, EventArgs e)
{
if (User.IsInRole("Admin") == true)
{
Server.Transfer("Admin/Default.aspx");
}
else if (User.IsInRole("SuperAdmin") == true)
{
Server.Transfer("SuperAdmin/Default.aspx");
}
else
{
Server.Transfer("User/Default.aspx");
}
}
I have no idea if this is the best way to do someting like this... But my problem is that when, let's say the Admin, loggs in they will get the user page(supposed to be admin's) the first time and it says that they have not been authenticated. However, if i hit back and login again it says that they have been authenticated and it goes to the right page.
Anyone have any ideas why this is hapening?
Thanks in advance
-- modified at 13:33 Sunday 23rd April, 2006
|
|
|
|
|
+ You should use the Response.Redirect method instead of the Transfer method to redirect the user to the default page.
+ Another option that you can try in the handler of the LoggedIn event handler is that after you determine the default web page based on the user role, you then simply assign the web page to the DestinationPageUrl property of the Login control, and have the control do the rest.
|
|
|
|
|
I dont think you are understanding my question. The user is not getting directed to the right page because they are not being authenticated when they hit login.
I put:
Response.Write(User.IsAuthenticated.ToString());
on the page that the user kept getting directed to after they logged in and it says false.
So for some reason, its not authenticating the user the first time they login. Which is weird because I have made it so that you need to be logged in before you can access the user page and yet it is letting them go there. So its a bit odd
Furthermore, when I switch Server.Transfer to Response.Redirect it keeps sending the user back to the login page!!?
Any ideas?
|
|
|
|
|
Sean89 wrote: I dont think you are understanding my question.
I'm sorry.
Sean89 wrote: Any ideas?
IMO, there are a couple of reasons as to why the application sends the user back to the login page:
+ The username/password is not correct (might not be this case).
+ The user account is not authorised to view the web page in the Admin or SuperAdmin folder. So could you double check the authorization settings of your application, especially for the Admin/SuperAdmin folder.
+ The authentication ticket is not added.
Have you tried to debug your application and step through your sample code line by line and see what is actually happening?
|
|
|
|
|
please check with the ispostback is true or false
with regards,
susa
|
|
|
|
|
this is the entry in db
<span id="Label1" style="font-family:Arial Narrow;font-size:XX-Large;font-weight:bold;font-style:italic;text-decoration: overline;">
Now when i retrieve in source code
string str = ds.Tables[0].Rows[1][1].ToString();
my str value contains the following value, where i found extra slashes with each quote, plus two extra quotes at the each end of the string
"<span id=\"Label1\" style=\"font-family:Arial Narrow;font-size:XX-Large;font-weight:bold;font-style:italic;text-decoration: overline;\">"
how to get rid of these quotes and slashes?
|
|
|
|
|
How do you reckon that value looks like that? Are you singe stepping through the code and looking at the watch windows?
That's the way you would write that string as a string constant, so that's how it's displayed.
---
b { font-weight: normal; }
|
|
|
|
|
>>How do you reckon that value looks like that? Are you singe stepping through the code and looking at the watch windows?
As i didn't get the desired result, so i stepped through the code looking at the watch window, and encounter these extra stuff.
>>That's the way you would write that string as a string constant, so that's how it's displayed.
sorry, i couldn't understand this.
|
|
|
|
|
sinanju wrote: >>That's the way you would write that string as a string constant, so that's how it's displayed.
sorry, i couldn't understand this.
An example:
If you have this text:
Text with "funny" characters.
and put that in a string in the code, it would be written:
string s = "Text with \"funny\" characters."
This is the way that the watch windows show it. It does so to be able to show unprintable characters like line breaks.
---
b { font-weight: normal; }
|
|
|
|
|
If a string contains quotes - which are interpretted by the compiler as start/end of string - you have to escape them to tell it that they are part of the string and not delimiting it.
Don't know about C, but in VB you can do this by by sinply doubling them - viz:
Dim str As String = ds.Tables[0].Rows[1][1].ToString.Replace(Chr(34), Chr(34) & Chr(34))
(Since Chr(34) = the quote character)
Hope that helps
Phil
|
|
|
|
|
This doesn't seem to help, im afraid.
istead the following seems to be a step to the solution
char[] strArr = ds.Tables[1].Rows[1][1].ToString().ToCharArray();
here strArr doesn't have the extra slashes or quotes, but now how to use this char array instead of string in my code.
As casting it back to string will get me the string with extra slashes as before.
|
|
|
|
|
I'm using AJAX to write Web application, there have two client (client1, client2) and server. Now i use XmlHttpRequest to send request to Server from Client1, after that, i want server send the response to Client2. But if i use Response.write(something here), Server always send to Client1, not Client2. How can i do???
Thanks!
|
|
|
|
|
You can't do that. The HTTP protocol simply doesn't work that way. You have to send a request from the client to be able to send a response back from the server.
---
b { font-weight: normal; }
|
|
|
|
|
So are there any way to do that? example some game online ?
|
|
|
|
|
Just do a request every N seconds that will ask the server if it has anything for the client. Of course you will have to write the code at the server side that will be able to do that.
But if you will only have two clients then you should defenitly write a windows application!
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
hey
i'll know how i can catch error in asp.net DADAX
-- modified at 13:51 Sunday 23rd April, 2006
|
|
|
|
|
Please write so somebody can understand you. I didn't understood a word you said.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
hey and sorry
just i need to know how i can catch error in asp.net
i hope that you understand me
and thanks anyway
DADAX
|
|
|
|