开发者

user input handling

开发者 https://www.devze.com 2023-03-10 18:10 出处:网络
How do you guys handle using the same form to input and edit data. I currently check to see if a param has been parsed in the form or querystring and action accordingly.e.g

How do you guys handle using the same form to input and edit data. I currently check to see if a param has been parsed in the form or querystring and action accordingly. e.g

string id = Request.QueryString.Get("id");
开发者_如何学C
if(id == string.Empty){
  //new input
}else{
  //get data from database etc
  //populate form
}


Normally i use hidden text box to store current record id and check same way as you did. But difference is, I use post not get.

And also use dynamic submit destination - for insert or update functions

I am not sure its a best way to implement that


Use Session, Session["ID"] = "ObjectID";

if(string.IsNullOrEmpty(Session["ID"])){
//new input
}else{
//get data from database etc
//populate form
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号