|
Jintal Patel wrote: protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridView1.EditIndex = -1;
}
Where did you update the values?
bEST rEGARD
pATHAN
---------------------------------------------------
|
|
|
|
|
Hi Pathan
Looks like you are trying to work with Grid View.
Well GridView1.EditIndex =-1 should be inside your GridView1_RowEditing(..)
inside your GridView1_RowUpdating() you should write your code for to update your database or whatever changes you need.
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
CreateEmployeeGrid();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
TextBox txtName = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtName");
TextBox txtSurname = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtSurname ");
DropDownList cmbGender = (DropDownList)GridView1.Rows[e.RowIndex].FindControl("cmbGender");
Employee.Update(GridView1.DataKeys[e.RowIndex].Values[0].ToString(),txtName.Text,txtSurname.Text cmbGender.SelectedValue);
GridView1.EditIndex = -1;
CreateEmployeeGrid();
}
I hope it helps you...
Cheers
mady
|
|
|
|
|
i m working on a content management system.i m creating dynamic pages on user input .my problem is i want to read the content of already existing .aspx page by getting the id of controls in the page.
e.g. i hv page 'aa.aspx' contains some text in a lable with id "lbl". so dat i can edit its content.and save the modified "aa.aspx".
so can anyone give any suggestion or reference to achieve this.
thanks in advance
alok tripathi
|
|
|
|
|
alok.mailbox wrote: e.g. i hv page 'aa.aspx' contains some text in a lable with id "lbl". so dat i can edit its content.and save the modified "aa.aspx".
This will be a hectic job for you. You can do this by writing regular expressions that matches with your search criteria. If you know the label id, you can write a regular expression that matches an asp:label and get it's value. Similar way use for writing also
|
|
|
|
|
Hi guys i need my webservice gets .ps file from word file using a virtual printer which is postscript printer. can any1 give a solution.
thnks...
|
|
|
|
|
I have a problem in aspx 2.0 how can I remove the restrictions on the password and username in the memebership control.
thank you
BiG RaLpH
|
|
|
|
|
|
I wasn't talking about the windows I was talking about the internet authentication in my application.
BiG RaLpH
|
|
|
|
|
Hello All,
I have a aspx page withing which i have two radio buttons. The user has to check any one option to move further. I have written a javascript which will check whether he has checked one option or not.
my problem is it is showing the alert to check one option but it is not stopping in the same page it is redirected to the next page even though the alert messaged poped up. Have i left something ???
Thanks and Regards
Bharath.S Ron
|
|
|
|
|
Bharath.S.Ron wrote: Have i left something ???
We can't say without seeing your Code.
SSK.
|
|
|
|
|
return true for valid condtion else return false for invalid condition from javascript function
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
One solution, to me, would be to remove the "AutoPostback" attribute on the radio buttons and provide with a Next>> button (provide validation for this) for the user to move further. There are other means, of course, but without having a glance at your code, i just can't say.
Hope this helps
Carpe diem,
Krg
|
|
|
|
|
OnClientClick="return getCheckedRadio();"
This is how i am calling the function is this correct???
Bharath.S Ron
|
|
|
|
|
|
the below is my javascript.
function getCheckedRadio()
{
if(document.getElementById("SOISummitRegistrationCntrl1_RdbtnRegAdvPck").checked==true)
{
return true;
}
else if(document.getElementById("SOISummitRegistrationCntrl1_RdbtnRegOnly").checked==true)
{
return true;
}
else
{
alert("Please check the option");
return false;
}
}
Bharath.S Ron
|
|
|
|
|
remove alert then try
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hey Sathish you changed your login name Why ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Sandeep Akhare wrote: Hey Sathish you changed your login name Why ?
He was trying to hide on another name, Because his first name made lot of issues. But all CP members can identify him seeing his style of writing. That he can't change.
|
|
|
|
|
|
Hi !
Here is what I would like to do.. User clicks on a button.
I want to create a report in text mode (generated by my ASP .NET application - C#) and then show a download box on the browser of the user to allow him to download this report. The filename of the report will be defined previously.
I have delete all header from my aspx page to just leave this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PageName.aspx.cs" Inherits="PageName" %>
and in my code behind i do:
Response.Write ("xxx");
How to show the download box on the screen ?
Thanks !
-- modified at 3:09 Friday 21st September, 2007
-- modified at 4:15 Friday 21st September, 2007
La Richesse & la Gloire ne griseront jamais que les temples
|
|
|
|
|
cREATE .TXT FILE DYNAMICALLY, WRITE CONTENT AND SAVE IT IN THE SERVER.
YOU CAN EASILY DOWNLOAD FROM THERE
bEST rEGARD
pATHAN
---------------------------------------------------
|
|
|
|
|
As Pathan said create a file at the server and store that file in one of the folders of your application and then download it bu using this code
<br />
string filename = "YourFileName.txt";<br />
<br />
if (filename != "")<br />
{<br />
<br />
string path = Server.MapPath(filename);<br />
<br />
System.IO.FileInfo file = new System.IO.FileInfo(path);<br />
<br />
if (file.Exists)<br />
{<br />
<br />
Response.Clear();<br />
<br />
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);<br />
<br />
Response.AddHeader("Content-Length", file.Length.ToString());<br />
<br />
Response.ContentType = "application/octet-stream";<br />
<br />
Response.WriteFile(file.FullName);<br />
<br />
Response.End();<br />
<br />
}<br />
<br />
else<br />
{<br />
<br />
Response.Write("This file does not exist.");<br />
<br />
}<br />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Thank you Sandeep for your answer.
1. unfotunately your code does not work... this condition is never true:
if (file.Exists)
=> i modify your code and it's working...
if (filename != "")
{
string path = Server.MapPath ( filename );
System.IO.FileInfo file = new System.IO.FileInfo ( path );
StreamWriter fp = File.CreateText ( path );
fp.WriteLine(text);
fp.Close ();
if ( file.Exists )
{
Response.Clear ();
Response.AddHeader ( "Content-Disposition", "attachment; filename=" + file.Name );
Response.AddHeader ( "Content-Length", file.Length.ToString () );
Response.ContentType = "application/octet-stream";
Response.WriteFile ( file.FullName );
Response.End ();
}
else
{
Response.Write("This file does not exist.");
}
}
2. I'm certain there is a way to show the download box without writing the file on the server.
Thanks !
La Richesse & la Gloire ne griseront jamais que les temples
|
|
|
|
|
Do one thing then get all content of your file in stream and pass that stream in this method hope that will help
By the way whats the problem in creating a file ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
There are already articles[^]on CodeProject that tell you how to do this.
Did you check before you posted?
Paul
|
|
|
|