|
Okay, I think I have something that might work for you. Each control (I believe) has an Attributes collection that you can programically add HTML attributes to elements. You can do this with the CustomValidator:
CustomValidator1.Attributes.Add("class", "somevalue"); I am not sure this is persisted via each post. So you may have to run this code on each postback.
Also, communicating via forum posts is difficult. If you don't give enough information (too much information is bad too) and I don't know your skill level, I get too general and don't answer your question properly.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi,
I've got a situation where I have a TreeView control and a SiteMapPath control that are both bound to a SiteMapDataSource control. Everything works great until my coleague redirects to the page with an old style query string full of variable data.
As advertised, if the current URL is not found in the SiteMapDataSource, the controls based on it are not shown.
Does anyone know a way to intercept the URL and modify it, strip off the query string before the other controls see it? All I've been able to find are "GET" only URL properties and events that don't appear to provide the opportunity to intercept it.
Thanks.
Will
|
|
|
|
|
Oddly enough, a couple questions down is an item about HttpContext.RewritePath that provided just the solution I was looking for.
|
|
|
|
|
How to open a new window when an imagebutton is clicked?
I want that when the imagebutton is clicked it calls a "IncrementAd()" method then it targets the user in another website but i want the window to open in a new window.
How can i make it happen pls??
Adrian De Battista - Web Designer, Web Programmer, Software Programmer From Malta. My Website .. www.MaltaTrade.org
|
|
|
|
|
Is it on Client side, or on Server side?
On clent side, it can be very simple, just write window.open("url", _blank)
On server side check here (at the very end of the thread)
http://www.dotnet247.com/247reference/msgs/31/158269.aspx[^]
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Hi guy I'm new and still learning asp.net(vb).I have 3 GridView in one form ,when page load,only the first GriView to be visible,It has the commandfield(select)when the user clicks the command fiels,make the first one invisible and second one visible(on the position of the first one)The second GridView have 2 commandfiels view(to allow the user to go to the Third GridView) and back(to allow the user to go to the first GridView).
When clicking the view on the second GriView make the second one invisible and third one visible(on the position of the first one). And Allow only the CheckBox of the third GridView to check and uncheck .Lastly Save Button to to save the information in table.
****
Pease guys this is acutellt what I what to do
***Please help me with the code for this
oga m
|
|
|
|
|
Hi,
Firstly on data command og 1st gridview make it visible false and make 2nd visible true and do the same for 3rd to be visible and then on save button click event save the related data.
Hope it helps u...
|
|
|
|
|
Hy everyone,
I need some help. My company has a Nomadix AG 3000 for guest internet access.I need to design a portal page that pass to nomadix ag3000 user name, password and user requested web page.The user name and password works fine. But I have no ideea how to pass the user requested page.
button value="Login">
|
|
|
|
|
Request.RawUrl ?
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Can you tell me how to use request.rawURL insaide my code.
Thank you
|
|
|
|
|
|
I Have a dropdown which the user can add items to using AJAX but I need to prevent Duplicates.
the dropdownlist.Options[index].value returns a number because of the way i'm databinding (i cannot change this).
Is there a Javascript property for the Name That will get me the text in the option tags rather than the value?
|
|
|
|
|
The following function is called upon the onBlur event of the textbox control (txt).
The following code does not work. Description of the function is: Search the ddl (an asp dropdown) for duplicates of the text in txt (asp textbox). Btn is an Asp.net Button that produces a postback and triggers the update panel in which only the ddl resides.
function CheckCaller()
{
var txt = document.getElementById("txtAddCaller");
var btn = document.getElementById("Button1");
var ddl = document.form1.ddlCaller;
var caller = trimAll(txt.value);
var found = "false";
if (caller != "")
{
for (i=0; i
|
|
|
|
|
I found a solution, thanks for looking.
|
|
|
|
|
Hello,
I have an ASP.NET app where I want to display a few labels and images on a page if the user hits the back button on the browser. How would i be able to capture the back button event of the browser on my app ? As in, If someone hits the back button, will any event be fired or can I have a javascript that can capture this event ? iam a little new to ASP.NET so sample code will help too !!!
this is my situation
Page(A)---> Page(B)
if someone presses the back button on Page(B) i want to show Page(A) with certain modifications. Thanks for your help !!!
Regards
RH
|
|
|
|
|
I have two Images that are in Itemtemplate one is sad.gif then the other is laughing.gif. then in EditItemTemplate is a RadioButtonList with two RadioButtons Good Mood and Bad Mood. all are in the same column. This is how it is supposed to work when Good Mood is selected, and insert button is pressed, the image laughing.gif is to be chosen. This code was supposed to work but I don't understand why it's not working:
<asp:Image id=Image1 runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem,"MoodToday")=="Bad Mood" ?"sad":"laughing" +".gif"%>' ImageAlign="Middle" Visible="False"></asp:Image>
But whether I select Good Mood or Bad Mood only the image laughing.gif is selected. Where could I be going wrong?
Thanks
|
|
|
|
|
I think that the problem is that the Eval method returns a value of type Object , and when you compare that to a string, it will compare them as objects, not as strings. Even if they have the same value, they are not the same object, so the comparison always fails.
Try casting the value from Eval into String .
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks Guffa
It has worked. This is how it worked I had to select Bad Mood By default and the code would be:
<asp:Image id=Image1 runat="server" ImageUrl='<%#"/Images/"+((string)DataBinder.Eval(Container.DataItem,"MoodToday")=="Bad Mood" ?"sad":"laughing") +".gif"%>'>
</asp:Image>
Thanks a lot.
|
|
|
|
|
Why is it that when I insert data I fast get an error :
Specified cast is not valid.
But When I run it the second time I find the data was saved the right image was selected! Actually I can say every thing works well apart that when I atempt to insert data this error appears: Specified cast is not valid. on line:
<asp:Image id=Image1 runat="server" ImageUrl='<%#"/Images/"+((string)DataBinder.Eval(Container.DataItem,"MoodToday")=="Bad Mood"?"sad":"laughing") +".gif"%>' ImageAlign="Middle">.
Thanks
|
|
|
|
|
Hi i have doubt in sqlserver database roles...,
in my sqlserver for a paricular database,i created two application roles..and i given permission for those roles also..,
Now how to tell the roles in my form code.....,
(i.e) how to interact with those roles from my .net codes...,
I dont know how to interact with those roles...,
so plz give me some idea..,if any sample codes will be there...,
it will be more usefull for me...,
Magi
|
|
|
|
|
Hi Magi,
You can achiev this by queryig "sysusers" table from the database.
All the roles are stored in this table.
So you can create sqlcommand for the query "Select * from sysusers" and get them in the form of datatable or datareader.
SqlCommand cmd = new SqlCommand("select dbid, name from sysusers");
I hope this will solve you issue.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
I have freamset in my web application
<frameset rows="138,*" cols="*" framespacing="1" frameborder="NO" border="1" bordercolor="#3366CC">
<frame src="Header.aspx" name="topFrame" scrolling="NO" noresize >
<frameset rows="*" cols="261,*" framespacing="0" frameborder="yes" border="0">
<frame src="Left.aspx" name="leftFrame" scrolling="NO" >
<frame src="main.html" name="mainFrame">
</frameset>
</frameset
in left.aspx file
<form id="form1" runat="server" target ="mainFrame">
and I added button1,button2
i want when user click on button2 change the target of frame from mainFrame to the same page(left.aspx).
I have tried--- Page.Form.Target = "leftFrame"
but it not working
tkml123
|
|
|
|
|
How to access a file residing in the client machine, when the path of the file is given through asp.net. But not through fileupload control.
Can any one help me in this code
|
|
|
|
|
You can't access files on the client machine in asp.net. To do that would be like a virus or spyware. You would have to use some javascript or activex controls. Again these would look like spyware to users. The user must upload the file from their machine to your web server, then you can access the file on the web server.
Ben
|
|
|
|
|
But when a client wants to upload a file to the server. He needs to use the application. Is there any way to do that? If there are activex controls, can you please name them
|
|
|
|