|
No this will not work with combo box or Radio button list. You can use Javascript to do apply.
Also what attribute you want to add on ListItem since there is no JS event like onchnage , onclick for element in HTML all events are for element
Nobody is perfect i'm Nobody
|
|
|
|
|
In JavaScript and HTML, I created an list of options for a select list that had a UserProperties opbject, in which I created a "list" of arbitrary sub-attributes, similar to the style attributes. Then I added a function that could get this information from the selected option. This all worked well for storing additional values in the options, which could be referenced when the select's onSelect/OnChange event fired.
Now, I want to include this capability in my component. I created a property that allows me to manage the UserProperties as an arrary. Then when the select list's children are created, I use the ListItem attribute.add method to push the array value into the option. Unfortunately, Mircrosoft let you add the attribute, but doesn't render tham.
I could pass the array to the page, and then hava javascript push the values into the options, but that would be redundant.
I was hoping that there was a render for the option that I could override, and then create the tag strings myself. In the past, before linking all of my sub-components together as childern under a main span element and then letting the render method do all of the work, I was explictly was calling the render for each sub-component explicity, and adding 'little bits' of hard coded html to the output stream to implement to new features I wanted in my component.
Now that the sub-components are all linked up as childern of the main span, I need some way to get the render to call my render method for the options instead of the built-in one.
It seems to me that if good modular programming practices were employed that the option rendering would be a seperate routine from the select rendering routine, and that the option rendering routine would be overridiable.
The online help says "Gets a collection of attribute name and value pairs for the ListItem that are not directly supported by the class." But then goes on to say "Use the Attributes collection to manage the attribute name and value pairs declared in the opening and closing tags of the ListItem, but not directly supported by the class. You can programmatically add or remove attributes to the collection."
When I look at the Attributes collection, there is a render method, but its not clear to me how I could call get my code in to execute it.
Any ideas?
Thank you
|
|
|
|
|
Hi,
I have a 3 columns in Gridview.I want to dispay the gridview with 1st and 2nd column as left aligned with header text and to display the 3rd column as right aligned with header text.I have adjusted the properties as row style -> Horizontal Align -> left and
Header Style -> Horizontal Align -> Left.
Now i want only 3rd column to be aligned right with header text.
Please tell me the property to be set or the code to be written in my HTML page. I am working in Visual Studio 2005 on vb.net platform. I have only .aspx pag and HTML page.I am not working in .vb page.
Thanks and regards,
Shyam T S ( beginner)
|
|
|
|
|
This is just a note to anyone else who might experience the same problem.
In a classic ASP environment, after installing SP2 to Windows Server 2003, the Session_OnEnd event in Global.asa no longer fires. I created the following demo web site (containing ONLY these two files) to demonstrate...
Default.asp:
<html>
<body>
<%= Application("Trace") %>
</body>
</html> Global.asa:
<SCRIPT LANGUAGE=JScript RUNAT=Server>
function Application_OnStart()
{
Application("Trace") = "WAITING FOR ANY SESSION TO END...";
}
function Session_OnStart()
{
Session("Dummy") = "Dummy";
}
function Session_OnEnd()
{
Application("Trace") = "SESSION END FIRED";
}
</SCRIPT> The web site will ALWAYS display "WAITING FOR ANY SESSION TO END...". No matter how long you wait and check back.
I see no solution. If anyone has one, please let me know. Thanks.
|
|
|
|
|
Hm? Why not keep the discussion in the same thread?
---
single minded; short sighted; long gone;
|
|
|
|
|
The original thread was a plea for help (one in which I did not know the answer).
This thread was posted separately, as a sort of "post mortem" -- to simply point out a bug in SP2 -- which will hopefully allow someone else experiencing the same problem to more easily become aware of the issue.
If I could delete the other thread entirely, I would -- as it is rather pointless now.
|
|
|
|
|
I see no such difference between this thread and the previous.
You have a bug, but you have not managed to identify it, so there is no telling if the bug is in your code or in the system. The fact that your code has not changed does not free it from suspicion.
---
single minded; short sighted; long gone;
|
|
|
|
|
Well, it's done now, isn't it. What do you want me to do? I can go delete all of my previous posts in the other thread if you want -- but that will leave a rather ugly mess now won't it?
In regards to my code, specifically the example at the head of this thread -- it's ridiculous to even suggest that there is a bug in that code. It is the simplest possible example to illustrate the issue that I'm talking about.
And it is a bug in SP2 -- simply by the definition that similar code has been working perfectly fine for YEARS on Windows 2000 Server, then YEARS more on Windows Server 2003 -- then SP2 is installed and BAM! -- it no longer works. And the technique is something that was promoted by Microsoft in the past.
The culprit is SP2. And there is absolutely NO DOUBT in my mind that it is a bug -- either accidental -- or by intentional depreciation.
Now, if there is some sort of work around -- then that is another issue entirely -- however I'm not aware of one and no one else has been able to offer one either.
|
|
|
|
|
|
can i return a hashtable from my webservice to the client application .. i hav tried but iyt dsnt allow.. so i added the hastable in an arraylist and returned the arraylist but there is still a problem
|
|
|
|
|
IDictionary cannot be serialized via XML, you will not be able to use the
hastable for a parameter over web services.
|
|
|
|
|
pls help me i m working on a project and requerement is :-
client wants to send mail to the responders outometically when they use the site with their mail id and name.
|
|
|
|
|
What language?
Brad
Australian
- bryce on "Problems with Code Project"
*sigh* Maunder's been coding again...
|
|
|
|
|
Dear sir
thanx for response.
currently i m working with c# language(ASP.NET).
i need ur help
jayant vaishnav
|
|
|
|
|
|
I am new to Enterprise Library January 2006 and its safe and gud to use with web application using asp.net. And also would like to have more information about Enterprise Library January 2006. Guide and Tx in advances
|
|
|
|
|
I have a classic ASP web site that has been running flawlessly for at least 6 years now.
I updated Windows Server 2003 to SP2 a few days ago, and now a "session counter" that I had implemented in Global.asa no longer works. Here is the code.
From Global.asa:
function Application_OnStart()
{
Application("Visitors") = 0;
}
function Session_OnStart()
{
Application.Lock();
{
Application("Visitors") = Application("Visitors") + 1;
}
Application.Unlock();
}
function Session_OnEnd()
{
Application.Lock();
{
iVisitors = Application("Visitors");
if( iVisitors > 0 )
{
Application("Visitors") = iVisitors - 1;
}
else
{
Application("Visitors") = 0;
}
}
Application.Unlock();
} It appears to me that Session_OnEnd is never being called now, because Application("Visitors") keeps incrementing with each session BUT never deincrements since installing SP2!
The code is so simple, that I can't see any reason why it is not doing so.
Can anyone see a flaw in my code? Or am I just hosed? 
|
|
|
|
|
There are certain session types that do not call Session end. Along with that the session doesn't end until it timesout. So if your session timeout has recently changed that could be the issue as well.
Here is the MS help on it:
The Session_OnEnd Event
You can handle the Session_OnEnd event by adding a subroutine named Session_OnEnd to the Global.asax file. The Session_OnEnd subroutine is run when the Abandon method has been called or when the session has expired. A session expires when the number of minutes specified by the Timeout property passes without a request being made for the session.
The Session_OnEnd event is supported only when the session state Mode property is set to InProc, which is the default. If the session state Mode is StateServer or SQLServer, then the Session_OnEnd event in the Global.asax file is ignored. If the session state Mode is set to Custom, then support for the Session_OnEnd event is determined by the custom session-state store provider.
You can use the Session_OnEnd event to clean up session-related information such as information for a user that is tracked in a data source by the SessionID value.
Hope that helps.
Ben
|
|
|
|
|
Yeah, I'm aware how sessions work.
Unfortunately, unless I'm mistaken, the MS Help information above applies only to the ASP.NET Global.asax... while I'm using the classic ASP Global.asa.
Thanks for your help though. I do appreciate it. I'll try digging deeper.
|
|
|
|
|
I created a new blank web site that has ONLY the following 2 files in it:
===========
DEFAULT.ASP
===========
<html>
<body>
Sessions: <%= Application("Visitors") %>
</body>
</html> ===========
GLOBAL.ASA
===========
<SCRIPT LANGUAGE=JScript RUNAT=Server>
function Application_OnStart()
{
Application("Visitors") = 0;
}
function Session_OnStart()
{
Application.Lock();
{
Application("Visitors") = Application("Visitors") + 1;
}
Application.Unlock();
}
function Session_OnEnd()
{
Application.Lock();
{
iVisitors = Application("Visitors");
if( iVisitors > 0 )
{
Application("Visitors") = iVisitors - 1;
}
else
{
Application("Visitors") = 0;
}
}
Application.Unlock();
}
</SCRIPT> ... and absolutely NOTHING else. I also adjusted the session length from 20 minutes to 2 minutes (for the purposes of testing).
Same thing... the value of Application("Visitors") keeps incrementing with each new session, but NEVER deincrements.
As mentioned, all of this has worked flawlessly for years upon years... but after installing SP2 to Windows Server 2003... all of a sudden it is broken.
I don't see anyway to fix this. Which blows.
Any ideas?
|
|
|
|
|
Try to put something in the session object:
Session("Test") = 42
This will keep the session object alive.
I think that it might be a change in how the server handles session objects. If they don't contain anything they are discarded immediately without triggering a Session_OnEnd. The session id is kept by the browser, so when the user returns a new session object with the same id will be created. As it's a recreated session object, it probably doesn't trigger a Session_OnStart.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks, but it's not that. The original web site where I noticed this has thousands of users and uses session variables to track login information across pages.
|
|
|
|
|
I am trying to write a script that can download a batch of PDF files from a site that requires users to login first. To login, I used the following code:
Dim objIE As New InternetExplorer<br />
<br />
objIE.Visible = True<br />
objIE.Navigate sURL<br />
<br />
Do<br />
DoEvents<br />
Loop Until objIE.readyState = READYSTATE_COMPLETE And objIE.Busy = False<br />
<br />
objIE.Document.all("username").Value = sUserName<br />
objIE.Document.all("password").Value = sPassword<br />
objIE.Document.forms("loginForm").Submit<br />
<br />
objIE.Navigate somefile.pdf
I am stuck after this point.
I cannot use:
objIE.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DONTPROMPTUSER
because it saves the file as text with a bunch of header info and binary contents corrupted.
I tried using
URLDownloadToFile(0&, somefile.pdf, sLocalFileName, 0&, 0&)
but this doen't work either because the request is not authenticated (the request returns the login page). The server doesn't support basic authentication, by the way
I think the answer is in the first parameter of URLDownloadToFile. If I can somehow pass the reference to the Internet Explorer object, the authentication info should, in theory, carry over. I haven't been able to find anything on the Web to help me with this, however.
Any thoughts?
Any alternatives?
Thank you.
A reasonable man adapts himself to the world. An unreasonable one persists, trying to adapt the world to himself. That is why all the progress in the world depends on the unreasonable men.
|
|
|
|
|
Hi,
In my project,i am having many .aspx pages
i am calling web methods from my each .aspx page separately.
In one of the form, my page_load event is firing.
After putting break point also, the break point is itself not executing.
Can any one of you tell me the reason for this.
In my web.config file, i set debug =true;
I made ensure regarding startup page and startup project.
Please reply as soon as possible
Thanks and regards,
Shyam T S
|
|
|
|
|
Is your project running in Debug or Release mode (the drop down on your toolbar will tell you this)? Even if you say Debug=True, if you are running in Release mode it wont stop on breakpoints.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that.'" - Tommy (Tommy Boy) "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|