|
Hi friends,
In my project i have registration form. In that if i fill and submitted the form to save all fields it works fine. After that if u click on refresh button in browser again record is saving.
So,how can avoid saving record twice if we refresh the page.
Any suggestions plz.........
Thanks in advance.
Regards,
Niranjan
|
|
|
|
|
Post details will be stored in the browser cache and will be posted again when you hit refresh. You can redirect to some confirmation page after adding. This will clear the post data and problem will be solved. Or if you don't want to use conformation page, then you can redirect to same page.
|
|
|
|
|
Thanks Navaneeth for giving suggestion.
Regards,
Niranjan
|
|
|
|
|
If possible then post your code.
Regards.
Rahul
rahul
|
|
|
|
|
Hi!
I have to make changes to a website which has been developed entirely in ColdFusion. However I am an ASP.Net programmer and do not have any idea about ColdFusion. Is it possible to have a part of the website in asp.net and a link in the coldfusion page which redirects to this page. Can someone help?
|
|
|
|
|
Hi i dont know about ajax and anthem...,
We can use ajax concept in vs2003?,
and its possible to use anthem in vs2003?,
And whats the difference between ajax and anthem???,
Plz clear my doubts...,
Regards,
Magi
|
|
|
|
|
Magh_M wrote: We can use ajax concept in vs2003?,
Yes. VS2003 don't have any AJAX framework available. But you can do thi by writting XMLHttpRequest using javascript.
Magh_M wrote: And whats the difference between ajax and anthem???,
anthem??? what is this ? Please make it clear
|
|
|
|
|
ya thank u,
Anthem is a third party toolbox...,
i heared that from one of my friend...,
Thats y i asked about ajax and anthem...,
Ok for this ajax we want ot install anything in our vs2003?,
or we can directly use the codes in our forms?,
Regards,
Magi
|
|
|
|
|
Magh_M wrote: Anthem is a third party toolbox...,
Sorry I don't have any idea on this. Instead of going for some third party programs, it's better to use your own script.
Magh_M wrote: Ok for this ajax we want ot install anything in our vs2003?,
For your information, AJAX is not only for .NET. It can be used with any web programming script. It's a concept where browser will give request to server asynchronously and avoids browser refresh. You can search for "using XMLHttpRequest in javascript" for getting started. Also check the browsers and versions that supports AJAX.
|
|
|
|
|
Ok, I have been searching for a while on this, and just cant work it out. I have web form with a INPUT type='file' called fileToAdd, and a textbox called tbTitle, and a button called btnUp.
The IDE is complaining about the line 'objStream.Read (bDocTemp, 0, iDocLength)', saying "'1-dimensional array of Byte' cannot be converted to '1-dimensional array of Char' because 'Byte' is not derived from 'Char'."
Fair enough, but I just cant figure out how to get it as a byte, all the examples I have found on the net for uploading images are the same as below, but it just wont work! If I DIM bDocTemp as a CHAR, the error goes away, but it wont work at run time.
Argghh! Any help will be appreciated please! Thanks
Protected Sub btnUp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUp.Click
Dim iDocLength As Integer = fileToAdd.PostedFile.ContentLength
Dim sExt As String = fileToAdd.PostedFile.FileName.ToString()
sExt = sExt.Substring(sExt.IndexOf(".", 0), 4)
Dim objConn As New SqlConnection("Data Source=XXXXX;Initial Catalog=XXXX;Persist Security Info=True;User ID=XXXXX;Password=XXXXX")
objConn.Open()
Dim objCmd As New SqlCommand("spUploadFile", objConn)
objCmd.CommandType = Data.CommandType.StoredProcedure
Dim pTitle As New SqlParameter
pTitle = objCmd.Parameters.Add("@Title", Data.SqlDbType.VarChar, 200)
pTitle.Direction = Data.ParameterDirection.Output
pTitle.Value = tbTitle.Text
Dim pType As New SqlParameter
pTitle = objCmd.Parameters.Add("@Type", Data.SqlDbType.VarChar, 3)
pType.Value = sExt.ToString
Dim bDocTemp(iDocLength - 1) As Byte
Dim objStream As StreamReader = New StreamReader(fileToAdd.PostedFile.InputStream)
objStream.Read (bDocTemp, 0, iDocLength) '<----Error here
Dim pDocument As New SqlParameter
pDocument = objCmd.Parameters.Add("@Document", Data.SqlDbType.Image)
pDocument.Value = bDocTemp
Dim pUser As New SqlParameter
pUser = objCmd.Parameters.Add("@user", Data.SqlDbType.VarChar, 50)
pUser.Value = Request.ServerVariables("AUTH_USER").ToString
objCmd.ExecuteNonQuery()
objConn.Close()
End Sub
-- modified at 1:26 Monday 16th July, 2007
|
|
|
|
|
Hi,
I made a simple report CrystalReport1.rpt which was added to my project (Add New Item => Crystal Report).
Now I want to use this report in my project, When i tried to write code in the code behind of the webform "CrystalReport1" code snippet did not appear. Then I typed the name of the report in the code:
CrystalReport1 = new CrystalReport1();
But I get this compile-error:
The type or namespace name 'CrystalReport1' could not be found (are you missing a using directive or an assembly reference?)
What is wrong?
Plz help.
Jagadeesh
|
|
|
|
|
Hi
Jagadeesh Jupalli wrote: The type or namespace name 'CrystalReport1' could not be found (are you missing a using directive or an assembly reference?)
Yes,
Add the foll. references to your project.
CrystalDecisions.CrystalReports.Engine<br />
CrystalDecisions.ReportSource<br />
CrystalDecisions.Shared<br />
CrystalDecisions.Web
and in your code behind file, import all the above references.
Hope this helps.
Harini
|
|
|
|
|
Yes I have added it in my code behind but its not working...
I kept like this...
using CrystalDecisions;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
using CrystalDecisions.CrystalReports.Engine;
Plz Help.
Jagadeesh
|
|
|
|
|
OK.
Hope you also added reference ("Add Reference..") to your project. Check again
Harini
|
|
|
|
|
Just now I added it by right clicking on my project solution explorer and select "Add reference" and selected
* CrystalDecisions.CrystalReports.Engine.dll
* CrystalDecisions.ReportSource.dll
* CrystalDecisions.Shared.dll
and clicked ok.
In the code behind i added these classes.
Even now i am unable to get the Report name in the codebehind snippet.
Plz let me know your thoughts.
Jagadeesh
|
|
|
|
|
Can you tell me how can i confirm that these references were added to my project.
I couldn't see any difference even after adding these references.
Jagadeesh
|
|
|
|
|
For an update, Just now I googled and found that We must get the "References node" after added the references.
But I am not getting it.
Plz let me know how to get it.
Jagadeesh
|
|
|
|
|
Hi
Added references should appear in the project explorer under 'References'.
If not add again.
Harini
|
|
|
|
|
I tried and tried, it again and again. Still its not displaying.
Plz help.
Jagadeesh
|
|
|
|
|
|
Harini,
I'm following these steps correctly.
When i binded a simple report using CrystalReportViewer control (with out using any dataset), It worked fine. (There is no code in the codebehind except the CrystalReportViewer bind property) It showed the values correctly.
When I tryed the same with the dataset in the code behind i am unable to get the reportname in the snippet.
CrystalReport1 crReportDocument = new CrystalReport1(); --> i'm not getting this report name here.
I am a fresher i don't know much about this. Is it compulsory to get the references node in the solution explorer to get the report name in the code behind.
Plz let me know your thoughts.
Jagadeesh
|
|
|
|
|
Harini,
I am able to view them (Resource node and its content) in my windows applications but Unable to view them in Web applications.
-Jagadeesh
|
|
|
|
|
I AM USING THE FOLLOWING CODE TO EXPORT THE GRID VIEW DATA INTO EXCEL.IT IS WORKING FINE WITHOUT PAGING THE GRIDVIEW .WHEN I DO THE PAGING IT GIVES THE FOLLOWING ERROR AT THE FOLLOWING LINE
frm.RenderControl(hw)
ERROR IS -: RegisterForEventValidation can only be called during Render();
CODE-:
Dim tw As New StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim frm As HtmlForm = New HtmlForm()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "attachment;filename=Filename.xls")
Response.Charset = ""
EnableViewState = False
Controls.Add(frm)
frm.Controls.Add(GridView1)
frm.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
CAN I EXPORT THE GRID VIEW DATA TO EXCEL BY GRIDVIEW PAGING.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Hi Sonia,
You better try this code using vb.net
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=RegisteredUsers.xls")
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter()
Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)
oHtmlTextWriter.WriteLine("Registered Users: ")
'Me.ClearControls(dgGrid)
DataGrid1.RenderControl(oHtmlTextWriter)
Response.Write(oStringWriter.ToString())
Response.End()
Regards,
Niranjan
|
|
|
|
|
Hi niranjan,
I also tried ur code in my datagrid...,
Its working when the paging is false...,
If paging is true...,
Ur code giving error on this line:
dgrdmain.RenderControl(oHtmlTextWriter)
So see sonia question properly...,
In paging only she is also getting error...,
Regards,
Magi
|
|
|
|