|
priya1515s wrote: but it's not working.
Define "not working" - I'm not a mind reader.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
priya1515s wrote: but it does not redirect to the target link instead it stays back to the current page.please help me out.
It may be possible that you are catching and suppressing this exception, thus not allowing it to continue up to the top to allow ASP.NET to handle it.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
"not working" meaning that the same problem occurs again.the page is not redirecting and stays back.
|
|
|
|
|
show us the piece of code. What is the value of url ?
|
|
|
|
|
Redirect internally calls Response.End which calls Abort function that raises ThreadAbortException exception upon completion. Plz post your stacktrace and code.
|
|
|
|
|
Hi,
I have a gridview and I have used Footer template to insert data. When there is no data returned from select method of object datasource The empty data text is displayed and nothing displays. I want that when there is no data then atleast the footer templates should be displayed so that new record can be inserted. How can i do this.
Please help...
|
|
|
|
|
Retrieve your data in a dataset begore databinding it to a gridview. Add a newrow() to you dataset if it has 0 rows:
i.e.:
myTable.Rows.Add(myTable.NewRow());
Your Gridview wil display an empty gridview row but also the footerrow.
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi i am new to Crystal report. I search google example and create a Report. But at execution it ask Login information each time. I had a VB code for solution.
Dim ConnInfo As New ConnectionInfo
With ConnInfo
.ServerName = ".sqlexpress"
.DatabaseName = "Northwind"
.UserID = "sa"
.Password = "eXpress2005"
End With
For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo
cnInfo.ConnectionInfo = ConnInfo
Next
End Sub
Can anyone tell the C# code to achieve this?
|
|
|
|
|
HI Karthik,
You can use this code for refrence to display crystal report.
sql= "";
DataSet ds = new DataSet();
OleDbDataAdapter AdpNew = new OleDbDataAdapter(sql,Conn);
AdpNew.Fill(ds);
Rpt ReportObject = new Rpt();
ReportObject.SetDataSource(ObjectName.Tables[0]);
ReportViewerName.Height = this.Height;
ReportViewerName.Width = this.Width;
ReportViewerName.ReportSource = ReportObject;
|
|
|
|
|
Need to change the date format in javascript.
format is dd/MM/yyyy
|
|
|
|
|
|
javascript does not have build-in date formatting. But, many people have wrote small js code to format date to various degree. Simple Google[^] search turns a wealth of examples.
|
|
|
|
|
Hi,
I am beginner in asp.net and my problem When i try to redirect with the code
Response.Redirect("~/Zone/Home.aspx?ZID=24&"); an exception is being raised i.e;
"Thread is being aborted" and after this redirection is done without any problems. What cud be the possible mistake made by me?
Plz help.
|
|
|
|
|
If you look at the Redirect[^] documentation, you will see it takes a second parameter of a type of bool to indicate if you want to terminate current page execution
use instead
Response.Redirect("~/Zone/Home.aspx?ZID=24&", false);
|
|
|
|
|
|
But, be aware that if you do set the value to false, the page you are currently on will continue to process. If the value is true (the default) then the page stops processing immediately.
See also the answer I gave here[^]
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Colin Angus Mackay wrote: See also the answer I gave here[^]
try{ // My code that does a redirect}catch(ThreadAbortException){ throw; // Continue throwing the ThreadAbortException}catch(Exception ex){ // Catch any other type of exception and handle the error.}
That is interesting, but I am not sure how it will work though.
In my code I use expensively try/catch. Then I have have catch all basin at the application level. Any unhandled exception will end up at the catch basin. If you rethrow the ThreadAbortException doesn't it get bubbled up. Don't you want to eat that exception?
|
|
|
|
|
Yusuf wrote: If you rethrow the ThreadAbortException doesn't it get bubbled up.
Yes, it will.
Yusuf wrote: Don't you want to eat that exception?
Nope. It is the exception that the Redirect method throws to force the end of execution. If you catch it and eat it execution resumes when you've already said you want it to stop so you can redirect elsewhere. (Although, I've been told that ASP.NET will automatically rethrow it if you catch it - which I didn't know before and wish to confirm before I change my stance as I don't see how it does it.)
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
I’m building a fairly typical ASP.NET web app that has a data entry screen, a number of maintenance screens, and some reports. The data entry screen and the maintenance screens all work in the same way; they use ListView controls embedded in UpdatePanels.
So far so good – they’re solid and reliable. However, performance is an issue for the data entry screen, and I don’t think using a ListView is going to be good enough. Using Fiddler, I can see that every postback sends 30Kb of data down the line, which seems a little excessive to me.
I’ve experimented with a ‘fast’ data entry screen. This one just uses a plain ol’ table, no UpdatePanels. I handle the click event on the client side by calling a web service that updates the database. This has got me from 30Kb down to 12 bytes!
The thing is, I’d like to retain use of the ListView if possible, because I want consistency with my other screens, and I’d like to continue to use the DataPager control. To do this, I’m obviously going to need to override the __doPostBack functions that the ListView generates.
My question is, is this going to be more trouble than it’s worth? Before I waste days of my life on this, is there a much better way of going about it?
|
|
|
|
|
Well, the reason you see big chunk of data (30k) being sent is because of control viewstate[^]. You can turn off the ListView viewstate, but you will loose all the controls viewstate functionality. Do you need to remember the control state between postbacks?
|
|
|
|
|
I'm planning to avoid postbacks and ViewState altogether, and just call webmethods from the client. I know I can easily do this without using a ListView at all, but I'd like to try it with the ListView so that I can keep using the DataPager (which only works with ListView).
So my plan is to just use the ListView like a Repeater to build my table, override the __doPostBack so that it does what I want (i.e. call a webmethod rather than do a postback), and hopefully still be able to use the DataPager.
I guess I'm just asking whether anyone else has tried that approach, or can suggest a better one, before I commit loads of time to it.
|
|
|
|
|
I'm not sure what you gain by getting rid of postbacks/viewstates. If you want to mimic the look and feel, then design your ListView then see the client side generated code. I don't have .net3.5 (which ListView is supported), but, I think, it will get rendered as table. Get the table layout and structure and use straight table with some css to achieve similar look and feeling.
If you want to override postback, then prepare to write some client side code to supplement. I know you mentioned you want to call webservices. Do you need to support sorting, pagination ....
In any case see here[^] and here[^] for one way of overriding postback function
|
|
|
|
|
Thanks Yusuf. The ListView is template-based, so will generate whatever you put in the template, but yes, that's usually tables.
Thinking about it, I guess the only thing I gain by keeping the ListView is easy pagination (the DataPager control). Maybe the easiest thing will be to just abandon ListView and write my own pager.
Thanks again.
|
|
|
|
|
Hi There,
I want to how to take data into xml from database.If anybody knows some usefull links from where I can get information then please reply.
Thanks.
|
|
|
|
|