Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Wednesday, March 28, 2012

TreeView in updatePanel , problem when visible is false

I have constructed a very simple webpage , an atlas updatepanel and TreeView inside and every thing goes O.k , until I set the initial value of the visible property of the treeview to false , here I added a button that when clicked , the visible of the tree is set back to true, now after the tree is visible , it is a big problem , a lot of javascript errors occurs and its nodes can't be collapsed or expanded and when clicking on some node the event SelectedNodeChanged is not raisedAny help to solve this problem is welcomed and appreciated...Thank you

TreeView control is not supported with UpdatePanel Control.


Actually , treeview is supported in atlas UpdatePanel and it does work

The only problem is that when the initial value of visible property of the tree is false

Any help is Appreciated

Wednesday, March 21, 2012

Trouble getting Value out of DynamicPopulate Populated Control

Hi:

I'm using a combination of AutoComplete and DynamicPopulate out of the AJAX Toolkit. The AutoComplete polls my Active Directory, then sends the selected name to the DynamicPopulate control. The DP control then sends me back an email address. Since the DP control will not populate a textbox's "Text" value, I decided to use a label. The label populates properly on the page, however, when I try to pull the value through my code, the label's text value is "". All population using the DP is done before the call for the values. Does anyone have any suggestions?

The label is being populated after the page loads; ASP.NET is a server side language, since the page hasnt posted back to the server yet, your code still thinks the value is empty.

Thanks for your reply. I understand why I can't get the value out, and I'm trying to prevent a postback, however, is there any possible other way to get these values out? I've tried a javascript "hacky" way to get the value into an HTML control, then finding the control to get it's value, but that's proving to be quite a feat in itself. Any suggestions?

Here's the set up:

I have a web service with two methods. One goes to my Active Directory and does AutoComplete on the name. Onblur, it calls the other method which takes the text in the AutoComplete text box and sends it back through the directory, which then returns the email address. A DynamicPopulate control populates a label (which is going to be hidden) in order for me to grab the email address. My structure is lenient, so any suggestions would be greatly appreciated!

Thanks

John


I'm having somewhat the same problem!

I use the DynamicPopulateextender to populate at Panel with information from a webservice. It works just fine but now i want to fetch the info and save it. If u get it to work, please tell me :)

Trouble with initiating a javascript function with a hyperlink

I have a page that is using ajax (javascript) to connect to a web service which does a number of back end features and then returns a value. This is being initiated from a hyperlink. I am having a hard time with the correct syntax for this. I am hoping for some help. The communication with the webservice works. I am just having trouble with the javascript syntax.

The link is as follows:

<a href="http://links.10026.com/?link=javascript:SubmitVote(1488,7cb84341-9a9f-4cd5-a714-550879c3dfa2);">Vote</a>

I want it to work with the following script (which has been simplified):

<

scriptlanguage="javascript"type="text/javascript">

<!--

function

SubmitVote(Num1, String1) {

funcRut = SubmitVote.SubmitVote(Num1.value, String1.value, OnComplete, OnTimeout, OnError);

return

true;

}

function

OnComplete(value) {

alert(value);

}

function

OnTimeout(value)

{

alert(

"OOPS - Timeout");

}

function

OnError(value)

{

alert(

"Oops - ERROR");

}

// -->

</

script>

Thank you kindly.

Hi,

i think you have just forgotten two single quotes for the second parameter:

<a href="http://links.10026.com/?link=javascript:SubmitVote(1488,'7cb84341-9a9f-4cd5-a714-550879c3dfa2');">Vote</a>

Regards
Marc Andre


Danke Marc. I knew it had to be something simple...it always is. I appreciate the effort.

Trying to make the CascadingDropDown read only

Hi, i'm trying to stop the CascadingDropDown value from being changed when the item the user is editing (via the formview control) is blocked. I notice there is no read only property on the DropDownList control or on the CascadingDropDown control so I figured the best way to do this was to disable the control and add a hidden field which would post the original value back.

<asp:Label ID="lblSectionIDValue" runat="server" Text='<%# Eval("SectionName") %>' Visible='<%# (bool)Eval("Blocked") %>'></asp:Label>
<asp:HiddenField ID="hfdSectionID" runat="server" Value='<%# Bind("SectionID") %>' Visible='<%# (bool)Eval("Blocked") %>' />
<asp:DropDownList ID="lstSectionID" runat="server" Visible='<%# !(bool)Eval("Blocked") %>'>
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="cddSectionID" runat="server" TargetControlID="lstSectionID" Category="Section" PromptText="-- Please Select --" LoadingText="[Loading sections...]" ServicePath="~/CascadingDropdownsService.asmx" ServiceMethod="GetSectionsList" SelectedValue='<%# Bind("SectionID") %>' Enabled='<%# !(bool)Eval("Blocked") %>' />

However a null value is being posted back instead of the original value. I've tried just about every combination now but nothing works. Without the CascadingDropDown control i can successfully say:

<asp:HiddenField ID="hfdSectionID" runat="server" Value='<%# Bind("SectionID") %>' Visible='<%# (bool)Eval("Blocked") %>' />
<asp:DropDownList ID="lstSectionID" runat="server" SelectedValue='<%# Bind("SectionID") %>' Enabled='<%# !(bool)Eval("Blocked") %>'>
</asp:DropDownList>

which posts the value back.

I think there is a bug in that some value is being sent back if the CascadingDropDown's enabled property is set to false and is overriding the value in the hidden field.

Hi here's a fix which creates a new property called EnabledOverride and works like the Enabled property for the standard controls such as the TextBox.

Edit CascadingDropDownExtender.cs:
============================

Add
-----
private const string stringEnabledOverride = "EnabledOverride";
-----

Add
-----
[DefaultValue("")]
[ExtenderControlProperty()]
public bool EnabledOverride
{
get
{
return GetPropertyValue(stringEnabledOverride, true);
}
set
{
SetPropertyValue(stringEnabledOverride, value);
}
}
-----

Edit CascadingDropDownBehaviour.js:
============================

Add
-----
this._enabledOverride = null;
-----

Add
-----
get_EnabledOverride : function() {
/// <value type="String">
/// Whether the drop down is enabled
/// </value>
return this._enabledOverride;
},
set_EnabledOverride : function(value) {
if (this._enabledOverride != value) {
this._enabledOverride = value;
this.raisePropertyChanged('EnabledOverride');
}
},
-----

Add (at the bottom of _setOptions function)
-----
_setOptions function (at the bottom):

// Disable the control if not enabled
if (!this._enabledOverride) {
e.disabled = true;
}
-----

Hope this helps you as much as it has me :).


You can try enclosing dropdown and cascadingdropdown in a server Div:





           <div runat="server" id="divEstado">



                                <asp:DropDownList ID="ddlEstado" runat="server" ></asp:DropDownList>



                                <cc1:CascadingDropDown ID="cddEstado" runat="server" TargetControlID="ddlEstado"



                                Category="Estado" PromptText="[Select value...]" ServicePath="Services.asmx"



                                ServiceMethod="FillData" UseContextKey="true" ParentControlID="ddlPais" /> 



          </div>



Disabling in code behind:



divEstado.Disabled = true;



Disabling in javascript:



$get('<%=divtrEstado.ClientID%>').disabled = 'disabled';


You can try enclosing dropdown and cascadingdropdown in a server Div:





           <div runat="server" id="divEstado">



                                <asp:DropDownList ID="ddlEstado" runat="server" ></asp:DropDownList>



                                <cc1:CascadingDropDown ID="cddEstado" runat="server" TargetControlID="ddlEstado"



                                Category="Estado" PromptText="[Select value...]" ServicePath="Services.asmx"



                                ServiceMethod="FillData" UseContextKey="true" ParentControlID="ddlPais" /> 



          </div>



Disabling in code behind:



divEstado.Disabled = true;



Disabling in javascript:



$get('<%=divtrEstado.ClientID%>').disabled = 'disabled';