|
Are you constrained to using Javascript? Otherwise, it's easy to access the template control from codebehind using the FindControl function. What are you trying to achieve? Again I think we need more code than you've provided for us to adequately help you.
|
|
|
|
|
Hi, I've designed a templated ASP.NET GridView Control. What I want to achieve is to change the HeaderText of one of the columns based on a DropDownList SelectedIndexChanged event. I placed a label into the HeaderTemplate:
<headertemplate>
<asp:label id="lblValueRate" runat="server" width="64px" xmlns:asp="#unknown">""
If a User selects 'Value' from the dropdownlist then I set the Text property of lblValueRate to 'Value' and if User selects 'Rate', changes to 'Rate'.
<asp:dropdownlist id="dbcValueRate" runat="server" autopostback="True" xmlns:asp="#unknown">
<asp:listitem>Rate <asp:listitem>Value
I've tried implementing it this way without success:
Label lblNew = (Label)GridView1.HeaderRow.FindControl("lblValueRate");
Then set lblNew.Text = Rate or Value
This didn't change the GridView Column Header so I thought perhaps I wasn't getting a reference to lblValueRate. So I tried using pointer in unsafe code, Like this:
Label* ptrLabel = &((Label)GridView1.HeaderRow.FindControl("lblValueRate"));
and dereferenced it this way: Label lblNew = *(ptrLabel);
But throws up error that can't get address of managed control.
I believe this is very trivial, but I seem stuck here. Thanks!
|
|
|
|
|
Yeah, I've solved the issue. The code works as it is. Made a few mix-ups elsewhere in code. It's interesting that the assignment,
Label lblNew = (Label)GridView1.HeaderRow.FindControl("lblValueRate");
copies the address as well, rather than just the value as we have, when we copy one variable to another? It was this consideration that made me consider using pointers as an alternative - thankfully, .NET does the 'dirty work' for you. Or so it seems.
Thanks everyone!
|
|
|
|
|
Hi,
I m using asp.net 2008 (framework 3.5) with Ajax. I have a requirement where i want to open modal pop up on selection of either yes/no from radio buttons.
Targetcontrolid of modal pop up extender is id of selected radiobutton. Although it opens the modal pop up but it does not retain the selected value of radio button.
I m also using update panel here to prevent postback but still it does not work.
If anyone can tell me what i m missing here.
|
|
|
|
|
I m using asp.net 2008 (framework 3.5) with Ajax. I have a requirement where i want to open modal pop up on selection of either yes/no from radio buttons.
Targetcontrolid of modal pop up extender is id of selected radiobuttonlist. Although it opens the modal pop up but it does not retain the selected value of radio button.
can anyone help
|
|
|
|
|
i have one usercontrol and that control i want to add user control in page using
fck editor.
i mean that i am adding the code <uc:control id=""> in fckeditor.
when i retrive that(fckeditor page) page in front i want to show the
user control.
regards
keyur satyadev
|
|
|
|
|
fckeditor is just an editor. You can use whatever editor your feel comfortable with.
I guess what you are looking for is User Controls[^].
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
I have several TextBox controls with initial values. When I tab between them, the OnFocus event blanks out the initial value by setting value="". When this happens, the caret disappears. This gives the user the impression that the control has lost focus, but it hasn't. This does not happen if you click in any of the TextBoxes with the mouse, only when tabbing into a TextBox. Any ideas?
|
|
|
|
|
Hello Everybody
I am using asp calendar control on my web page but its big according to the page i have set its width and height but its not resizing..
Thanks.
|
|
|
|
|
I guess this thing happens because the size of div or table is large where you put this calendar control..
so first of all checkout size of that where your control is...
if i am not right then give some description or code..
thanks..
|
|
|
|
|
Thanks for reply
i have checked that out its not matter if i am using only calendar control on whole page then also the same problem after setting height and width its size is not changing..
|
|
|
|
|
Can you please send the code..so i can understand it..
Because it works fine at my side..
|
|
|
|
|
i am able to make it big but not able to make it small in size.
<asp:calendar id="cal" runat="server" height="10px" width="12px" xmlns:asp="#unknown">
thanks.
|
|
|
|
|
thanks for reply
its done first we have set its all day and header style then we will be able to..actually i needed it urgent..
|
|
|
|
|
Ok..its good ..
Please now onwards make clear and if possible send the full code to make us clear abt problem..
Thanks..
|
|
|
|
|
Hello Friends,
I'm opening a notepad file on a button click by using the following line of code
System.Diagnostics.Process.Start("Notepad.exe");
and it's working fine on localhost but as i upload it over my server it arises an error Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
so can anybody suggest me the way to solve it out
|
|
|
|
|
|
Sorry bro, the url u gave me is good i'm n't getting the solution.... If you have any other way please let me know
|
|
|
|
|
You know this is opening notepad on the server - not the client...?
|
|
|
|
|
I know, but how can i avoid my error.
|
|
|
|
|
Hi. I've two drop down list in asp.net form. first one is a standard server side drop down list control and binded from the server side. second one is html select element and binded through javascript at the client side by AJAX depending upon the value selected from the first drop down list. after binding second drop down list when we post back the page, i'm unable to access all the element of the second drop down list at the server side even second is has attribute runat server. where is problem???
|
|
|
|
|
Bound on the client side using AJAX? Is this using the built in UpdatePanel, or are you making a web service call?
|
|
|
|
|
using a XMLHttpRequest object.
|
|
|
|
|
for example i want to change authentication mode from form to windows
is this possible??
Government Dyal Singh College Lahore.
|
|
|
|
|
It's XML, a C# app could read it as such and modify it. If it can be accessed from within your website code, I guess you'd have to try and see.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|