|
I think they are two different things but only differing slightly.
The cures to both are fairly similar
Becareful transferring variables in a URL
Dont trust user input, you never know what is going to be input.
Just make sure plenty of validation is available for the input boxes
|
|
|
|
|
hi,
I am new to asp.net, and planning to write a new web application which contains a Grid of Rows and need to provide insertions and updates to the rows of the grid. I want the application to be more user efficient, means when I try press on Insertrow button it shouldn't postback the whole page. I want to develop this in a quick time, so if anybody has the code or any links to these kind of applications I appreciate that.
Thanks.
|
|
|
|
|
Maybe you should have allowed some more time as you are a new to asp.net
No one is going to give you the code.
Try paying someone who knows what they are doing to create it for you
|
|
|
|
|
I am going to have to agree with .netman. You are new to a language/technology but you need an entire application completed quickly. We are here for specific questions. I suggest buying a book or see if you can find something through Google.
|
|
|
|
|
I want to display the icon of a file (filename.extension) that is stored in table using GridView
|
|
|
|
|
maybe find out what file extension it is and then apply suitable icon on the fly
|
|
|
|
|
Hello Everybody
I am trying to develop a online order project. When customer add item then it item information will save into session data table.
Just think customer add 5 items into his/her basket when he/she click btnSubmit then i want to add all 5 items into orderDetails table using one insert statement(sometimes customer can order upto 100 iems we dont know how items customer add)
As i think
insert into tableName (itemID, Quantity, Price) values (here should be loop) and how can I add loop?
Any instruction will be really helpful
Sarfarj Ahmed
|
|
|
|
|
DataTable dt = (DataTable ) Session["DataTable"];
foreach(DataRow dr in dt.Rows )
{
// You can use to get record from datarow like dr["ColumnName"]
ItemId= dr["itemID"];
Quantity = dr["Quantity"]
Price = dr["Price"]
// call you function or write code for insert Record into database
}
I think this will help you.
Regards
rajesh
|
|
|
|
|
Rajesh_K_Sharma wrote: Session["DataTable"];
Check for NULL or existence of session value before casting it to escape from any exceptions.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Rajesh_K_Sharma wrote: foreach(DataRow dr in dt.Rows )
{
// You can use to get record from datarow like dr["ColumnName"]
ItemId= dr["itemID"];
Quantity = dr["Quantity"]
Price = dr["Price"]
// call you function or write code for insert Record into database
}
This won't insert items in one shot.
|
|
|
|
|
Thanks Rajesh
Concept you gave me it should be work (if i get any problem then i will let you know)
Thanks
Sarfarj Ahmed
|
|
|
|
|
Sarfaraj Ahmed wrote: I am trying to develop a online order project. When customer add item then it item information will save into session data table.
This is not a good design. You can keep the user's items in database. When user places order, remove from this table. It would be more efficient than session.
Sarfaraj Ahmed wrote: all 5 items into orderDetails table using one insert statement
Lop through datatable records, form insert query, don't execute it inside the loop. When loop ends, execute the query. So you will get all the records inserted.
|
|
|
|
|
Thanks for your reply
My database design is like this
tblOrder (orderID (PK), customerID(FK), dateStamp, totalPrice)
tblOrderDetails (orderID(FK), itemID(FK), Quantity, Price)
as you said I can create another table like tblTempOrder (orderID(FK), itemID(FK), Quantity, Price)
when customer will click btnConfirmOrder then it will add all data into tblOrderDetails
from tblTempOrder then remove all data from tblTempOrder
my question is what will happen if that customer cancel that order but he forgot to click btnCancel?
waiting for your answer
Thanks in advace
Sarfarj Ahmed
|
|
|
|
|
also could you please tell me how i can add all data from tblTempOrder to OrderDetails , writing only one single insert statement
Tanks in advance
Sarfarj Ahmed
|
|
|
|
|
Hai all
Can u tell me how to find out previous and next month.I have one text box and two buttons on my page named Next And Previous.When form gets loaded the current month will be displayed in text box. When i click on Next button the next month date should be displayed in text box.When i click on Previous the previous month date should be displayed in text box. Can any one help me.
Thanks in advance.
Regards
Lijo
|
|
|
|
|
use AddMonths(-1) to subtract 1 month from a date. Fr example:
DateTime dt = DateTime.Now.AddMonths(-1);
|
|
|
|
|
Thank you. It was verymuch help full for me.
Regards
Lijo Rajan.
|
|
|
|
|
I fail to see why the eventhandlers of a control in an asp page must be protected. If I'm trying to declare the methods private I get an 'inaccesible due to its protection level'. This means that the Web.UI.Page base class is responsible for calling the eventhandler? I never done ASP so please bear with me
|
|
|
|
|
I know that Protected methods or functions whatever you'd like to call them, can only be executed by the containing class and/or any class that inherits the containing class, and (might be wrong about this part)since your aspx page does inherit from the codebehind class the event handlers and any function used on the page must be either protected or public, i would recomend protected, but if their private the inherited class cant access them, so you get that exception. Hope i helped.
|
|
|
|
|
Thanks, so the Inherits attribute in the aspx file defines the code behind file from where the web form inherits. Actually the code behind file stand in front of the aspx file in the inheritance tree. It's clear now
|
|
|
|
|
|
Btn_CloseWindow.OnClientClick = "window.close();";
this line is not executing when pressing button first time ? it working from second click please help me in this.
Regards
Rajkumar.
|
|
|
|
|
What is the error?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
use
Btn_CloseWindowAttribute.add("Onclick", "javascript:window.close();")
hope this help.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Can you please confirm where you wrote this code, on page load or click of the button itself?
*jaans
|
|
|
|