Click here to Skip to main content
15,922,584 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: About Calendar Popup Pin
Venkatesh Mookkan20-Jul-08 17:26
Venkatesh Mookkan20-Jul-08 17:26 
QuestionRe: About Calendar Popup Pin
Abhijit Jana20-Jul-08 17:30
professionalAbhijit Jana20-Jul-08 17:30 
AnswerRe: About Calendar Popup Pin
Gayani Devapriya20-Jul-08 18:03
Gayani Devapriya20-Jul-08 18:03 
GeneralPhantom Class Declaration Pin
Brady Kelly20-Jul-08 0:14
Brady Kelly20-Jul-08 0:14 
GeneralRe: Phantom Class Declaration Pin
Brady Kelly21-Jul-08 0:00
Brady Kelly21-Jul-08 0:00 
QuestionWebservice redirection Pin
kallzzr19-Jul-08 15:30
kallzzr19-Jul-08 15:30 
AnswerRe: Webservice redirection Pin
Herman<T>.Instance20-Jul-08 21:45
Herman<T>.Instance20-Jul-08 21:45 
Questionediting in datalist Pin
strawberrysh19-Jul-08 9:18
strawberrysh19-Jul-08 9:18 
I write this code for editing datalist.there is an upload and two textbox in EditItemtemplate .but when I go to edit mode ,sometimes I want to edit only ,for example name in one textbox and I don't want to change or upload a picture for it.at this time this code has error because the upload control is empty. what should I do?
protected void datalist_editcommand(object source, DataListCommandEventArgs e)
    {
        DataList1.EditItemIndex = e.Item.ItemIndex;
        DataList1.DataBind();
    }
    protected void datalist_cancelcommand(object source, DataListCommandEventArgs e)
    {
        DataList1.EditItemIndex = -1;
        DataList1.DataBind();
    }
    //updating datalist
    protected void datalist_updatecommand(object source, DataListCommandEventArgs e)
    {
        int stid = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]);
        TextBox firstname = (TextBox)e.Item.FindControl("txtfirst");
        TextBox lastname = (TextBox)e.Item.FindControl("txtlast");
        FileUpload picupload = (FileUpload)e.Item.FindControl("FileUpload1");
        string filename=Path.GetFileName(picupload.FileName);
        picupload.SaveAs(Server.MapPath("~/pic/")+filename);
        SqlConnection con=new SqlConnection(connectionstring);
        string sqlup = "update stt set stname=@stname,stlastname=@stlastname,picture=@picture where stid=@stid";
        SqlCommand com = new SqlCommand(sqlup, con);
        com.Parameters.AddWithValue("@stid", stid);
        com.Parameters.AddWithValue("@stname", firstname.Text);
        com.Parameters.AddWithValue("@stlastname", lastname.Text);
        com.Parameters.AddWithValue("@picture","~/pic/"+filename);
        con.Open();
        com.ExecuteNonQuery();
        con.Close();
        DataList1.EditItemIndex = -1;
        DataList1.DataBind();
       
    }
    //deleting a record of datalist
    protected void datalist_deletecommand(object source, DataListCommandEventArgs e)
    {
        int stid = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]);
        SqlConnection con=new SqlConnection(connectionstring);
        string sqldel = "delete from stt where stid=@stid";
        SqlCommand com = new SqlCommand(sqldel, con);
        com.Parameters.AddWithValue("@stid", stid);
        con.Open();
        com.ExecuteNonQuery();
        con.Close();
        DataList1.DataBind();

    }

AnswerRe: editing in datalist Pin
Imran Khan Pathan20-Jul-08 20:03
Imran Khan Pathan20-Jul-08 20:03 
QuestionUpdate Opener's Parent Pin
Abhijit Jana19-Jul-08 3:36
professionalAbhijit Jana19-Jul-08 3:36 
AnswerRe: Update Opener's Parent Pin
Guffa20-Jul-08 2:47
Guffa20-Jul-08 2:47 
GeneralRe: Update Opener's Parent Pin
Abhijit Jana20-Jul-08 3:18
professionalAbhijit Jana20-Jul-08 3:18 
GeneralRe: Update Opener's Parent Pin
Guffa20-Jul-08 11:40
Guffa20-Jul-08 11:40 
GeneralCustomise Precompiled Web Site Pin
Brady Kelly19-Jul-08 3:10
Brady Kelly19-Jul-08 3:10 
QuestionNeed Urgent Hepl : Printing a Web Page containing GridView Pin
Intellect19-Jul-08 1:06
Intellect19-Jul-08 1:06 
AnswerRe: Need Urgent Hepl : Printing a Web Page containing GridView Pin
Paul Conrad19-Jul-08 15:23
professionalPaul Conrad19-Jul-08 15:23 
Question[Message Deleted] Pin
sugunavathysubramanian19-Jul-08 0:41
sugunavathysubramanian19-Jul-08 0:41 
AnswerRe: how to get datasource from database to gridview Pin
Blue_Boy19-Jul-08 0:58
Blue_Boy19-Jul-08 0:58 
GeneralRe: how to get datasource from database to gridview Pin
sugunavathysubramanian19-Jul-08 1:21
sugunavathysubramanian19-Jul-08 1:21 
GeneralRe: how to get datasource from database to gridview Pin
Blue_Boy19-Jul-08 1:23
Blue_Boy19-Jul-08 1:23 
QuestionRe: how to get datasource from database to gridview Pin
Abhijit Jana19-Jul-08 1:28
professionalAbhijit Jana19-Jul-08 1:28 
AnswerRe: how to get datasource from database to gridview Pin
Blue_Boy19-Jul-08 10:16
Blue_Boy19-Jul-08 10:16 
GeneralRe: how to get datasource from database to gridview Pin
Ma tju20-Jul-08 22:20
Ma tju20-Jul-08 22:20 
GeneralRe: how to get datasource from database to gridview Pin
Blue_Boy21-Jul-08 2:58
Blue_Boy21-Jul-08 2:58 
QuestionScreen resolution problem in asp.net application Pin
Rameez Raja18-Jul-08 23:50
Rameez Raja18-Jul-08 23:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.