Click here to Skip to main content
15,895,779 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: end to end communication + asp.net Pin
Rajeesh MP12-Mar-09 1:27
Rajeesh MP12-Mar-09 1:27 
QuestionAjax? Pin
Karthick_gc11-Mar-09 22:19
Karthick_gc11-Mar-09 22:19 
AnswerRe: Ajax? Pin
SeMartens11-Mar-09 22:24
SeMartens11-Mar-09 22:24 
AnswerRe: Ajax? Pin
Christian Graus11-Mar-09 23:11
protectorChristian Graus11-Mar-09 23:11 
AnswerRe: Ajax? Pin
Abhijit Jana11-Mar-09 23:55
professionalAbhijit Jana11-Mar-09 23:55 
QuestionDate format Pin
rakeshs31211-Mar-09 21:57
rakeshs31211-Mar-09 21:57 
AnswerRe: Date format Pin
Expert Coming11-Mar-09 22:43
Expert Coming11-Mar-09 22:43 
QuestionDelete confirm() in gride view Pin
toufiq_raja11-Mar-09 20:16
toufiq_raja11-Mar-09 20:16 
//file1.aspx
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TxtJobID" runat="server"></asp:TextBox>
<asp:TextBox ID="TxtJobTitle" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
Text="Update" OnClientClick="return confirm('Are You Sure');" Font-Bold="True" />
<br />
<br />
<asp:Label ID="lblMessage" runat="server" Text="Label" Width="474px"
style="background-color: #00cccc"></asp:Label><br />
<br />
<asp:DataGrid id="DataGrid1" OnItemCommand="ItemCommand"
style="Z-INDEX: 101; LEFT: 175px; TOP: 105px"
runat="server" CssClass="tx-tbl-Gr-lml" Width="474px" AllowPaging="true" >
<Columns>
<asp:ButtonColumn Text="Edit" ButtonType="PushButton" CommandName="Edit">
</asp:ButtonColumn>
<asp:ButtonColumn Text="Delete" ButtonType="PushButton" CommandName="Delete">
</asp:ButtonColumn>
</Columns>
</asp:DataGrid><br />
</div>
</form>
</body>

//file1.aspx.cs

public partial class _Default : System.Web.UI.Page
{
OracleConnection cn;
OracleCommand cmd;
protected void Page_Load(object sender, EventArgs e)
{
cn = new OracleConnection("data source=dev;user id=hr;password=hr");
if (!Page.IsPostBack)
{
BindData();
}
}
void BindData()
{
string strsql = "select job_id,job_title from jobs";
OracleDataAdapter da = new OracleDataAdapter(strsql, cn);
DataTable dt = new DataTable();
da.Fill(dt);
DataGrid1.DataSource = dt;
DataGrid1.DataBind();
}
protected void ItemCommand(Object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
FillTheData(e.Item.Cells[2].Text, e.Item.Cells[3].Text);
lblMessage.Text = "";
}
if (e.CommandName == "Delete")
{
lblMessage.Text = "Need Code to call confirm() frunction ";
}
}
void FillTheData(string job_id, string job_title)
{
TxtJobID.Text = job_id;
TxtJobTitle.Text = job_title;
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string strsql = "Update jobs set job_title="+"'"+TxtJobTitle.Text+"'"+" where job_id="+"'"+TxtJobID.Text+"'";
cmd = new OracleCommand(strsql, cn);
cn.Open();
cmd.ExecuteNonQuery();
BindData();
lblMessage.Text = "Updated Successfully";
}
catch (Exception ex)
{
lblMessage.Text = ex.Message;
}
finally
{
cn.Close();
}
}
}
AnswerRe: Delete confirm() in gride view Pin
keyur satyadev11-Mar-09 21:53
keyur satyadev11-Mar-09 21:53 
GeneralRe: Delete confirm() in gride view Pin
toufiq_raja11-Mar-09 23:30
toufiq_raja11-Mar-09 23:30 
GeneralRe: Delete confirm() in gride view [modified] Pin
keyur satyadev12-Mar-09 2:27
keyur satyadev12-Mar-09 2:27 
AnswerRe: Delete confirm() in gride view Pin
Expert Coming11-Mar-09 22:44
Expert Coming11-Mar-09 22:44 
AnswerRe: Delete confirm() in gride view Pin
kumar_k50811-Mar-09 23:47
kumar_k50811-Mar-09 23:47 
GeneralRe: Delete confirm() in gride view Pin
anujbanka178412-Mar-09 0:53
anujbanka178412-Mar-09 0:53 
Questiona problem of AjaxPro and js Pin
peacefulheart11-Mar-09 19:34
peacefulheart11-Mar-09 19:34 
QuestionExport Datagrid to Excel Pin
rakeshs31211-Mar-09 18:56
rakeshs31211-Mar-09 18:56 
AnswerRe: Export Datagrid to Excel Pin
Ashfield11-Mar-09 21:53
Ashfield11-Mar-09 21:53 
QuestionRe-using usercontrol into a different project. Pin
Juvil John11-Mar-09 18:10
Juvil John11-Mar-09 18:10 
AnswerRe: Re-using usercontrol into a different project. Pin
Rajeesh MP11-Mar-09 19:17
Rajeesh MP11-Mar-09 19:17 
AnswerRe: Re-using usercontrol into a different project. Pin
Juvil John12-Mar-09 13:20
Juvil John12-Mar-09 13:20 
QuestionSQL Server Express, Authentication, Visual Studio, and a Web Host that doesn't support SQL Server:( Pin
rmterenz11-Mar-09 17:46
rmterenz11-Mar-09 17:46 
AnswerRe: SQL Server Express, Authentication, Visual Studio, and a Web Host that doesn't support SQL Server:( Pin
Rajeesh MP11-Mar-09 19:26
Rajeesh MP11-Mar-09 19:26 
Questionset a page as the main page Pin
prasadbuddhika11-Mar-09 17:44
prasadbuddhika11-Mar-09 17:44 
AnswerRe: set a page as the main page Pin
Abhijit Jana11-Mar-09 18:43
professionalAbhijit Jana11-Mar-09 18:43 
QuestionModify the SqlDataSource without altering the gridview Pin
TerRO_GirL11-Mar-09 11:43
TerRO_GirL11-Mar-09 11:43 

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.