|
______________________
stuff + cats = awesome
|
|
|
|
|
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Dear sirs:
I have a simple ASP.NET WebForm; on it are: a combo-box (for months) and a submit button, an SqlDataSource (for chart data), a GridViewControl (interface between sql data source and chart control) and a chart control.
When I select a month from the combo box and hit a button, the proper data is displayed in the chart control. However, when I select another month from the combo box the same data is again displayed.
I made sure to wipe out the double-array that holds the data by instantiating a new instance of it in the constructor of the class in which it resides.
Here's what's interesting: if I click on the browser's "back" button and then the "forward" button; and then hit the "submit" button, the grid displays the proper data for the new month in the drop down combo box.
What is happening? What can I do to make sure the data from the sqldatasource/gridview is synched with the filter-select variable in the combo box?
Thanks in advance,
Rob Hyland
|
|
|
|
|
I think that i faced that kind of problems once.
It could be two reasons.
1. You put the databinding function in wrong place.
2. You may need to add some unique keys for getting the latest result. This is the reason probably for you. When I was using SQL Reporting Service in ASP.NET project, I faced the same problem that I was not able to get the latest data for my report even I passed the correct parameter.
Then, the solution was that I add the unique key (eg: timestamp) as paramenter to my report. Whenever I generate the report, i used to pass this timestamp value as a paramenter to report. Then, i got the latest result..
You may read for the problem and solution that I said above in this link. http://michaelsync.net/2007/05/13/tipstricks-aspnet-with-sql-reporting-services/
|
|
|
|
|
Michael:
Thanks for the quick response. If I understand you correctly, what you are implying that I should do is something like the following. Let's say that a portion of my SelectCommand of the SqlDataSource looks like so (this is Oracle P-SQL):
"..... where EXTRACT( MONTH from mh.historydatetime) = :MONTH_ID"
Now, the bind-variable comes from the SelectedIndex of the drop down combo box. What you are saying to do, in essence is something like the following:
"..... where EXTRACT( MONTH from mh.historydatetime) = :MONTH_ID AND :TIMESTAMP_INFO = :SUBMIT_TIME"
That sounds quite difficult. For one: how do I put the timestamp info into a variable? Secondly, what is the logic behind this? As long as a different month is selected from the drop down, it should use the new data, right?
Regards,
Rob
|
|
|
|
|
Hi Everybody
On my project I have a gridview with a button. When someone click the button then new page will be open with those parameter which is related on gridview
Thanks
Sarfarj Ahmed
|
|
|
|
|
Sarfaraj Ahmed wrote: : Open New window with some parameter
<br />
window.open ("http://www.javascript-coder.com?par1=1&par2=2",<br />
"mywindow","menubar=1,resizable=1,width=350,height=250");
|
|
|
|
|
I'm confused.
I'm new to ASP.NET, but already have enough experience with plain old HTML/classic ASP to get by (I'm more of a C/C++ guy trying to expand my horizons).
I have page that performs some database operations, with an asp:label that shows the result either in green or red text to indicate success or failure. I've defined two CSS classes:
.clsMessageSuccess<br />
{<br />
color: Green;<br />
}<br />
.clsMessageFailure<br />
{<br />
color: Red;<br />
}
Then at runtime, depending on the result of the database operation, I change my label's CssClass property to either clsMessageSuccess or clsMessageFailure. Works great.
Now I'm trying to revisit this and do things "the ASP.NET way" using themes and skins. I've defined the following in my .skin file:
<asp:Label runat="server" SkinID="sknResultLabelSuccess" ForeColor="Green" /><br />
<asp:Label runat="server" SkinID="sknResultLabelFailure" ForeColor="Red" />
I thought I'd simply be able to replace my label's SkinID property at runtime like I'm currently doing for CssClass. No such luck:
"The 'SkinId' property can only be set in or before the Page_PreInit event for static controls. For dynamic controls, set the property before adding it to the Controls collection."
Great. I could understand why, and it looks my approach is plain wrong, but what I don't understand then is how it should be done "properly". I could just forget about the whole skins idead and just change the label's ForeColor property instead of its SkinID (which apparently isn't allowed), but this goes against the very nature of code/styling separation. What if I also wanted to make the text bold? I'm not going to start changing multiple properties every place I'm currently trying to replace the SkinID.
Why not stick with replacing CssStyle? Because my master page uses one .css file, and it's getting quite long. It contains different sections that are only used by specific pages. I want to break that out into multiple .css files and *only* include the required files in the pages that need them. However, the master page is the one containing the head tag (and closes it), so I can't include additional .css files in other aspx files (or if I can, I haven't found out how). Traditionally, in classic ASP, I've been able to include multiple css files without any issue (eg, I have one basic css file that applies to all pages--which I've now put in the master page--and other files that apply only to the page in question). What's the proper way to do this in ASP.NET?
I'm starting to dislike the way ASP.NET does some things. Themes/skin files sound great in theory, but then looking at the HTML generated, I see it takes the attributes defined in skin files and applying them directly as style attributes to individual controls. Awesome. So CSS files made us take styling out of the HTML, but then skins adds them back?
-- modified at 10:24 Wednesday 11th July, 2007
|
|
|
|
|
|
Interesting links. I'll look into them.
Thanks Michael
|
|
|
|
|
Hi All,
I want to bind a list box with three columns from a table.
Could you please advice.
Thanks
|
|
|
|
|
Why do you wanna use "Listbox" instead of "GridView"?
|
|
|
|
|
Is Gridview of ASP.NET 2.0 is equivalent of Datagrid 1.1
Thnx in Advance
|
|
|
|
|
GridView has more advanced features than DataGrid.
Please read this article for comparing GridView and DataGrid (GridView Vs DataGrid).
|
|
|
|
|
Hello Everyone,
Can anybody let me know to through focus/cursor blinking on a text box as
the page get loaded.
i'm using the following command given below as i use in ASP.NET with 1.1
and this piece of code run fine in ASP.NET 1.1 but generating error in ASP.NET 2.0
function myFocus()
{
document.form1.txtName.focus();
}
ERROR:- myFocus() not found
|
|
|
|
|
You are writing this code in Single aspx page or Master page or content page or what?
What you can do is that you can view the sourcecode in browser and find out whether this function still there or not...
|
|
|
|
|
Hi Everybody
.aspx page I used DetailsView and GridView. GridView has three Columns ErrorID, ErrorType and ErrorDate. If I click on ErrorID then DetailsView will show the whole information (Same Page GridView then DetailsView)
Here is my code which is binding GridView1
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim _AuditLog As AuditLog = New AuditLog()
_AuditLog = CType(e.Row.DataItem, AuditLog)
If (_AuditLog Is Nothing) Then
Else
Dim lblErrorID As Label = e.Row.FindControl("lblErrorID")
Dim lblErrorType As Label = e.Row.FindControl("lblErrorType")
Dim lblErrordate As Label = e.Row.FindControl("lblErrorDate")
lblErrorID.Text = _AuditLog.ErrorID.ToString()
lblErrorType.Text = _AuditLog.ErrorType.ToString()
lblErrordate.Text = _AuditLog.DateStamp.ToString()
End If
End Sub
Now wot should be code for DetailsView. I dont want to write any code inside .aspx file, it will be .vb or .cs
Any help will be greatful for me
Sarfarj Ahmed
|
|
|
|
|
|
Hi,
In my project, there is a web service(that acts as business layer), which fetches data from the datalayer(ie class library). when i try to populate data to a grid control in my windows form, nothing happens, ie no data is populated & no error is fired. i am accessing the project from my local network via VSS. when i try to run the web service by using IE, it shows the warning The test form is only available for requests from the local machine...
will anybody help me to get out of this..
thanks in advance
Sebastian
|
|
|
|
|
|
Thank you, I have tried the first method listed here, and that doesn't help me. i receive the same message..
sebastian
|
|
|
|
|
Can someone tell me if this is possible please. I have created a web based reporting application for my boss and he wants the option to export the tables that get shown to a .csv file. Seems reasonable except I am pretty sure that as it's web based I can only write back to the server...is this true? If not what do I do to save the .csv on his local machine? I was thinking that maybe I can save it on the server then try and open it on via the browser so the standard download attatchment window comes up? is there a set/standard or best practice way of doing this?
Thanks in advance for any help.
Ian
|
|
|
|
|
|
So having a quick glance thru that article and the code for it, that just writes a csv string to the browser. I can do that already, I can parse the table to a csv stream no probs.
My question and what I am more interested in knowing about is how I can export a .csv file from the datatable to a file through a button click on the browser...do i have to save the csv on the server? or can i save it straight to a user specified location on the local machine? I was thinking that if it wasn't possible to save to the user's local machine do I save it to the server with a unique name then try and open the file from the server? Is that the best way of doing things? or is there a reccomended best practive for this? Thanks for taking the time to help.
Cheers
Ian
|
|
|
|
|
Check into placing the results in a stream.
|
|
|
|