|
I'm assuming that you are using the ASP.NET AJAX library, and that you're attempting to perform your drop-down manipulation on the client side. If that is the case, then you may wish to have a look at the AJAX Control Toolkit's Cascading DropDown[^] control. If I understand your post correctly, it does exactly what you're looking for.
As to whether it will improve performance or not, that is difficult to say. As with anything performance related, its much wiser to measure and not to speculate.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
|
Guys,
I am having nightmare in figuring out how i can pass the initial search phrase from the seach page to subsequent ascx controls, i can see it appearing on the first ascx control contained in master page, when i load the subsequent ascx control it gets lost, i need to capture the search phrase on first page and keep passing it to as QueryString to other subsequent pages by appending it to the URL of the page.
Can anyone help?
Thanks
happy coding!
|
|
|
|
|
If you are attempting to pass this value around different pages of your application, then you would have to rewrite all urls that the data is relevant to so that they include the query string argument. Unless I misunderstand your intent, what you're actually trying to do is take a value from the query string and treat it as a piece of shared state, across multiple pieces of content in your application. I would recommend that you consider using the ASP.NET Session object, unless your environment makes that prohibitive for some reason.
Hope that helps a bit.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
make sure that within your application where ever you are redirecting to some other page you url with query string is not overwritten. make sure you are passing the query string parameter as well.
Faraz Shah Khan
MCP, MCAD.Net
Blog
|
|
|
|
|
I have this piece of code which is called everytime to check for session- when the application starts and before every page is displayed.
if(Context.Session != null)
{
if(Session.IsNewSession)
{
string _sCookieHeader = Request.Headers["Cookie"];
if((_sCookieHeader != null) &&(_sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0))
{
Response.Redirect("SessionExpire.aspx");
}
}
}
else
Response.Redirect("SessionExpire.aspx");
It works fine everywhere except for production server where it always takes me to SessionExpire page. I have checked the cookie settings and its the same on production server as others. I would appreciate if someone could tell me what can I do to fix it on that server. Is it that Context.Session is always null or something with the cookies?
Thanks
|
|
|
|
|
Is there some specific reason you aren't using Session.Start in the Global.asx file?
led mike
|
|
|
|
|
My first page is a login page and when user logs in, I want to start a session and keep track of it afterwards. If I use Session.Start in global.asax file, it will create a session as soon as the application starts. Is that correct??
|
|
|
|
|
No, Session.OnStart or whatever it's called is executed on a new session. the Application.OnStart or whatever it's called is for when the applications starts.
led mike
|
|
|
|
|
I can use Session_Start of global.asax file.
I need to display a message to the user if session has expired after say 1 minute and take user to a different page than login page. How do I differ between if Session has expired or if its a new login?
|
|
|
|
|
Don't bother with that. It's ridiculous user fluff on the Web. Just say "Your session may have expired" or something. Don't go adding a bunch of hacked complexity to try and get browsers and HTTP to do things they were never designed to do just to supply users with perfect message, that is just foolishness.
led mike
|
|
|
|
|
|
Programmer in the Making wrote: I am wanting users to vote on the priority (emergency, high, med, low) of a request.
Who are these users? If they are the average monkey you may as well just use a random number generator.
led mike
|
|
|
|
|
|
Ok, that tells me nothing
led mike
|
|
|
|
|
|
Programmer in the Making wrote: an idea of what request we need to work on first when it comes to fixing our software.
So you are talking about a bug (issue) tracker system. I would never have known that from your original post.
Have you done a comprehensive study and concluded that none of the existing systems[^] have that feature?
led mike
|
|
|
|
|
I have some code I was (attempting) to optimise, and came across a weird problem...
I have a button, and 2 Calender Controls
Here's the code
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
string date = "2008/03/27 12:36:00 PM";<br />
<br />
int year = Convert.ToInt32(date.Substring(0, 4));<br />
int month = Convert.ToInt32(date.Substring(5, 2));<br />
int day = Convert.ToInt32(date.Substring(8, 2));<br />
int hour = Convert.ToInt32(date.Substring(11, 2));<br />
int minute = Convert.ToInt32(date.Substring(14, 2));<br />
<br />
<br />
<br />
DateTime dt1 = new DateTime(year, month, day);<br />
Calendar1.SelectedDate = dt1;<br />
<br />
DateTime dt2 = Convert.ToDateTime(date);<br />
Calendar2.SelectedDate = dt2;<br />
}<br />
Looks the same, correct?
That's what I thought...
The Problem - After the Button is clicked, the 1st Calender has it's date selected, and the second one doesn't...
Now, the thing is, if you change:
DateTime dt1 = new DateTime(year, month, day);
to
DateTime dt1 = new DateTime(year, month, day, hour, minute, 0);
then the first Calender "Breaks", and doesnt select the date...
Any suggestions as to why?
|
|
|
|
|
I would imagine that it has to do with the default date parsing and locale. Try changing your date declaration to 03/27/2008 12:36:00 PM or use the DateTime.Parse overload that allows you to specify the composition of your date string.
Hope that helps.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
No luck...
Neither
string date = "03/27/2008 12:36:00 PM";<br />
<br />
DateTime dt2 = Convert.ToDateTime(date);<br />
Calendar2.SelectedDate = dt2;
nor
string date = "2008/03/27 12:36:00 PM";
<br />
DateTime dt2 = DateTime.Parse(date);<br />
Calendar2.SelectedDate = dt2;<br />
select...
Any other suggestions? 
|
|
|
|
|
hrmm... both worked for me in a prototype. Try:
string date = "03/27/2008 12:36:00 PM";
DateTime myDate = DateTime.Parse(date, "MM/dd/yyyy hh:mm:ss tt");
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
string date = "03/27/2008 12:36:00 PM";<br />
DateTime myDate = DateTime.Parse(date, "MM/dd/yyyy hh:mm:ss tt");
The best overloaded method match for 'System.DateTime.Parse(string, System.IFormatProvider)' has some invalid arguments
Argument '2': cannot convert from 'string' to 'System.IFormatProvider'
Might be because I'm using .NET 3... 
|
|
|
|
|
Gah! Nope, the problem is not framework version, the problem is me working from memory and mixing languages up. Never try to answer a .NET date parsing question while writing an Oracle stored procedure that uses a date range.
My apologies. My bad.
Be sure to call the Date property of your date when setting the selected date. That appears to be the culprit. For example:
string date = "03/27/2008 12:36:00 PM"; DateTime myDate = DateTime.Parse(date); this.Calendar.SelectedDate = myDate.Date; this.Calendar.SelectedDayStyle.BackColor = System.Drawing.Color.Blue;
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|
|
Omg...
string date = "2008/03/17 12:36:00 PM";<br />
DateTime myDate = DateTime.Parse(date);<br />
this.Calendar1.SelectedDate = myDate;
compiles, but doesnt work, whilst
string date = "2008/03/17 12:36:00 PM";<br />
DateTime myDate = DateTime.Parse(date);<br />
this.Calendar1.SelectedDate = myDate.Date;
compiles and works...
Thanks alot
Update:
This is going STRAIGHT to Subtle Bugs...
|
|
|
|
|
My pleasure. I'm glad that its working. My apologies, again, for the hasty post and wrong turn in the middle there.
--Jesse "... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi
|
|
|
|