|
yes i have multiple tables associated with the datasource of gridview and i want to update that record
|
|
|
|
|
Good Morning haleemasher
In my early days of Programming i used to write my application using all this sorts of wizards it was great and i enjoyed it and forgot that i had to write code sometimes, but the wizards did everything for me. In my Applications there was a time where i needed to update data from a Join Now there is a limitation for Wizards , they dont know which table to update or wich field even though it looked obvious to you what table to update. This leads me to the World of N-Tier Development where i had to Start Writting my own DAL(Data Access Layer) and update the Grid. Am sorry to say this , this means you have to write your own Data layer and update the grid and the Correct table , because the SqlDatasource wizards cannot do it for you in this case. i have articles that i wrote when i had a problem see below
Coding an N-Tier Application in C# Without Any Wizard: Part II[^]
Good Luck
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
hello
i want to display value of gridview row in another page having label give me solution
|
|
|
|
|
Member 4480959 wrote: i want to display value of gridview row in another page having label give me solution
On GridViewSelected Index Changed Event, Read the Selected Row in object of GridViewRow Class. Then Store the Object in Session and Access from Next Page.
|
|
|
|
|
Pass the value through URL as query string. In the second page, you can read this and display on the label.
|
|
|
|
|
Very good article for you.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi ,
i have used a Regular expression to validate the textbox to number format.
<asp:textbox id="TextBox5" runat="server" cssclass="InputField" tooltip="Enter Invoice Date (DD/MM/YYYY)" ontextchanged="TextBox5_TextChanged" maxlength="10" autopostback="True" >="">
<asp:regularexpressionvalidator id="regexpName" runat="server"
="" errormessage="This expression does not validate."
controltovalidate="TextBox5"
validationexpression="^\\d{1,4}(\\.\\d{1,3})?$" enableviewstate="true">;
i have one problem.
that is in textbox, if i enter 22.1 it has to become 22.10
or 22 it has become to format 22.00
protected void TextBox5_TextChanged(object sender, EventArgs e)
{
double a;
a = Convert.ToDouble(TextBox5.Text);
TextBox5.Text = String.Format("{0:f3}", a);
}
it changes the format but it does not validate then.
i.e it is been trigered after the validation.
i.e even if i enter 111111 it just appends zeroes like 111111.000 .
so is there any way i could do the validation and change the format after validation in the textbox.
thanks in advance.
sriharsha
|
|
|
|
|
This works as you expected. I assumed that you have set Textbox1.AutoPostBack = True; Even though the error has been captured by the validation control it doesn't causes validation for textbox. So TextBox5_TextChanged has been fired.
Make the TextBox's CausesValidation = "True". Its working fine as you expected and I have checked it. Please let us know if you find any problem.
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
hi,
its working . i made TextBox's CausesValidation = "True".
thanks a lot
i had one more problem , is there any way i could always keep zeroes in the decimal places while typing the number in the textbox.
thanks and regards,
sriharsha
|
|
|
|
|
if you use .net 2.0 or .net 3.5 you can use this .
try here [^]
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
hi,
i have tried using masked edit extender and maskedvalidating extender
but the problem here is it allows to enter in any location of the textbox .
i.e if input is 111111.10
no problem
but if input is 1_____.10
it gets converted to 1000000.10 automatically.
or if input is __12_.10
it gets converted 120.10
how can we solve this problem.or is there any other way we can have zeroes in decimal place always in the textbox while typing.
Thanks and regards,
sriharsha
|
|
|
|
|
If you look this control is nothing but a DLL you can modify it as well. So modify this control or try to get a javascript functionality for this one.
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
Dear All,
I have an aspx page which contains link to different files created in different application such as .PDF, .doc, .txt, .xls etc.
My requirement is to open each type of files in their respective application window.
I tried System.Diagnostics.Process.Start method, but it does not works in client browser.
Please help, if any one knows how to handle it.
Shivanandan C V
|
|
|
|
|
Shivan Nandan wrote: I tried System.Diagnostics.Process.Start method, but it does not works in client browser.
Yes, It will execute on Server Only.
Shivan Nandan wrote: I have an aspx page which contains link to different files created in different application such as .PDF, .doc, .txt, .xls etc.
My requirement is to open each type of files in their respective application window.
Give Link with each of the file. So that user can able to download file from there. When user will Click on the link he should get message with "Open" , "Save" , "Cancel" Button . Which is the common scenario of web application.
|
|
|
|
|
Thanks for the response. But it is opening the files in the browser window itself.
e.g., if I click on .doc file link, it should launch MS-Word and the file is to be opened in that application[assumed that MS-Office is already installed]. The same case is with MS-Excel, PDF[PDF reader installed] etc.
Shivanandan C V
|
|
|
|
|
Shivan Nandan wrote: But it is opening the files in the browser window itself.
This is browser dependent and you have zero control over how it displays.
|
|
|
|
|
Hi all,
Very good mrng all.. I am using ajax password strength control. If i move tab key the comment "Very poor" is appearing before entering any text into the textbox. Can any one resolve the pbm by giving your suggestion.
|
|
|
|
|
TextStrengthDescriptions can have 10 text descriptions at max. So you can change "very poor" string and instead you can show a status like "Not entered".
Hope that helps.
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
I have a fileupload control in my form for uploading PDF files. The issue is it is working fine in my local host and failing in production server. It is giving error that "Error Uploading File. The path is not of a legal form".
Following is my code:
protected void DocumentUploadButton_Click(object sender, EventArgs e)
{
string errMsg = string.Empty;
string PDFFilename = string.Empty;
string PDFSaveLocation = string.Empty;
if (DocumentFileUpload.HasFile)
{
string DocFileName = Path.GetFileName(DocumentFileUpload.PostedFile.FileName);
string FileExtension = Path.GetExtension(DocumentFileUpload.PostedFile.FileName);
string appPath = System.Web.HttpContext.Current.Request.ApplicationPath;
if (!appPath.EndsWith("/", StringComparison.Ordinal))
{
appPath = String.Concat(appPath, "/");
PDFFilename = Path.GetFileName(DocumentFileUpload.PostedFile.FileName);
ViewState["PDFFilename"] = PDFFilename;
PDFSaveLocation = Server.MapPath(String.Concat(appPath, "/tmp/")) + PDFFilename;
Label3.Text = "PDFFileName: " + PDFFilename;
Label1.Text = "PDFLocation: " + PDFSaveLocation;
DocumentFileUpload.PostedFile.SaveAs(PDFSaveLocation);
}
try
{
Guid g = AddFile(DocumentFileUpload.FileBytes, PDFFilename);
ViewState["DocumentFileId"] = g;
File.Delete(PDFSaveLocation);
DocumentUploadedCustomValidator.IsValid = true;
}
catch (Exception ex)
{
string strmsg = ex.Message;
Label4.CssClass = "ErrorMessagesLabel";
Label4.Text = "Error Uploading File. " + strmsg;
}
}
Any idea what is the issue? Please help.I am not getting any head and tail of the issue since it is working fine in local system. It is not even printing the path and pdf file name.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Did you checked the path where the file is getting upoloaded on production?
Cheers!!
Brij
|
|
|
|
|
I tried to get the path from where it is getting uploaded. For that purpose, I have adde a label control to print the path , Label1.Text = "PDFLocation: " + PDFSaveLocation;, But that itself, is not printing.
Even the the PDFFilename itself is not printing, Label3.Text = "PDFFileName: " + PDFFilename;
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: The issue is it is working fine in my local host and failing in production server.
Make sure the Folder where you are uploading files is exists.
Now, There could be the issue with Folder Permission . In Local System, your .NET Application runs with ASP.NET Engine , which having the all kinds of permission that it can writes on your disk.
No, In Production when you have Hosted the sites on IIS Server, IIS run by default "Network Service" Identity, which having the minimum permission to read the files from server, NO Write Access .
Possible Resolution :
1. Give the Write Access Permission to Everyone for that Folder where you are uploading file.
2. Create a Separate Application Pool for you web application, Change the Identity of the Application pool to "Local System " which allows client to Write on your Server.
Hope This Will Help You
|
|
|
|
|
Thanks for your answer.
I am not getting the path of the production server even though I tried to print using a label control. So I think I will go for the second resolution. Can you please tell me how can I create the application pool? Any articles would suffice.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
meeram395 wrote: I am not getting the path of the production server even though I tried to print using a label control.
Need to check Code again.
meeram395 wrote: Can you please tell me how can I create the application pool? Any articles would suffice.
Yes, This is from one of my article,Please have a look on Application Pool Section . If you have interest, then you can read it all
|
|
|
|
|
Well, all you are doing is uploading the file to a tmp directory which is in your application root, right? If yes, you don't have to use Request.ApplicationPath . Also many other code what you have given is unnecessary. Here is a modified version
string fileName = Path.GetFileName(DocumentFileUpload.PostedFile.FileName);
string saveFilePath = Path.Combine(Server.MapPath("/tmp/"), fileName);
DocumentFileUpload.PostedFile.SaveAs(saveFilePath);
ViewState["PDFFilename"] = fileName ; Note : I have written this directly on CP, so excuse the syntactic issues.
|
|
|
|