AJAX Control Toolkit MultiHandleSlider readOnly handle - asp.net

I have a question about AJAX MultiHandleSliderExtender. Code is following:
<form runat="server" id="myForm">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="false" />
<asp:TextBox ID="strMinModTB" runat="server" Style="display:none;" Text="80" />
<asp:TextBox ID="strCurModTB" runat="server" Style="display:none;" Text="100" />
<asp:TextBox ID="strMaxModTB" runat="server" Style="display:none;" Text="160" />
<asp:TextBox ID="strSlider" runat="server" Style="display:none;" />
<asp:MultiHandleSliderExtender ID="strModMultiSlider" runat="server"
BehaviorID="strModMultiSlider"
TargetControlID="strSlider"
Minimum="0"
Maximum="300"
Length="600"
EnableHandleAnimation="true"
EnableKeyboard="false"
EnableMouseWheel="false"
ShowInnerRail="true"
ShowHandleDragStyle="true"
ShowHandleHoverStyle="true">
<MultiHandleSliderTargets>
<asp:MultiHandleSliderTarget ControlID="strMinModTB" />
<asp:MultiHandleSliderTarget ControlID="strCurModTB" />
<asp:MultiHandleSliderTarget ControlID="strMaxModTB" />
</MultiHandleSliderTargets>
</asp:MultiHandleSliderExtender>
<asp:Label ID="sliderLabel" runat="server" Visible="true"></asp:Label>
</form>
Now what I want to do is to lock positions of outter handles and allow only the middle one to be dragged in range from the left hanle to the right one thus changing the value in asp:Label (ID="sliderLabel").
I've tried readOnly="true" attribute on TextBoxes but with no result. There is also IsReadOnly Extender property but that blocks all handles.
Also when I add the BoundControlID property (containing ID of label) to the Extender it stops working (all handles on 0 position and I cannot drag them)
Is there a way around this or am I missing something?
Thank you for replies :)

You don't need a BoundControlID for the MHSE do you?
Also, could you not add a class to each Handle and then fix the outer handles positions using CSS?
See below for code example.
ASP Code
<asp:MultiHandleSliderExtender ID="strModMultiSlider" runat="server"
BehaviorID="strModMultiSlider" TargetControlID="strSlider"
Minimum="0" Maximum="300" Length="600"
EnableHandleAnimation="true" EnableKeyboard="false"
EnableMouseWheel="false" ShowInnerRail="true"
ShowHandleDragStyle="true" ShowHandleHoverStyle="true">
<MultiHandleSliderTargets>
<asp:MultiHandleSliderTarget ControlID="strMinModTB" HandleCssClass="handle_outer"/>
<asp:MultiHandleSliderTarget ControlID="strCurModTB" HandleCssClass="handle_inner" />
<asp:MultiHandleSliderTarget ControlID="strMaxModTB" HandleCssClass="handle_outer"/>
</MultiHandleSliderTargets>
</asp:MultiHandleSliderExtender>
CSS Code
.handle_outer
{
//Code to Fix Handle in Place
}
.handle_inner
{
}

Related

ASP.NET Repeater FindControl not working for Label, but works for Textbox

I'm facing issues trying to get controls from my repeater. I have one label and one textbox. The label is giving me a null reference error, however the textbox is working.
Markup:
<asp:Repeater ID="PalletsRepeater" runat="server" OnItemDataBound="PalletsRepeater_ItemDataBound">
<ItemTemplate>
<div style="margin-left: 20px; margin-top: 5px;">
<asp:Label lbl="lblPalletId" Text='<%#"Pallet "+Eval("PALLETID")%>' runat="server" />
<asp:Label Text=", Qty = " CssClass="field-label-blue" runat="server" />
<asp:TextBox ID="txtPalletItemQty" runat="server" Text='<%# Eval("ITEMQTY") %>' step="1" type="number" />
</div>
</ItemTemplate>
</asp:Repeater>
Code Behind:
foreach (RepeaterItem repeaterRow in PalletsRepeater.Items)
{
// This fails.
string palletId = ((System.Web.UI.WebControls.Label)repeaterRow.FindControl("lblPalletId")).Text;
// This works.
string palletItemQty = ((System.Web.UI.WebControls.TextBox)repeaterRow.FindControl("txtPalletItemQty")).Text;
}
I have researched this on Stack Overflow and most answers involve using the OnItemDatabound event, but when I tried to implement those answers, it still comes back null for the label. Personally I don't understand the suggestions as far as using the OnItemDatabound event.
Change
<asp:Label lbl="lblPalletId" Text='<%#"Pallet "+Eval("PALLETID")%>' runat="server" />
Into
<asp:Label id="lblPalletId" Text='<%#"Pallet "+Eval("PALLETID")%>' runat="server" />
You cannot find it because it has no ID

how to use Autocompleteextender in modal popupextender

I am using autocompleteextender in a modalpopupextender....the dropdown in auto complete is shown in background....this problem occured in chrome....in firefox give expected output......
My code is....
<asp:TextBox ID="txtpincode" runat="server" TabIndex="1"
CssClass="autotxtbx" AutoPostBack="True" OnTextChanged="txtpincode_TextChanged"
onchange="AutoClear()" Width="100"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
TargetControlID="txtpincode" ServiceMethod="getpincode"
MinimumPrefixLength="1" OnClientItemSelected="ItemSelected"
FirstRowSelected="true" runat="server" CompletionListItemCssClass="autocmpl"
CompletionListHighlightedItemCssClass="autotxt" UseContextKey="True" />
<asp:HiddenField ID="hdnUserField" runat="server" />
I use this in a modal popup extender....the resul in chrome is....!
Yes the only issue was with the AutoCompleteType. You can do it like this.
`AutoCompleteType="Disabled"`

my balloon pop up doesn't work

I am using a pop up but it cant show any thing in final render.
Can any body tell me what is wrong in my cods:
Thank you very much
Here is my code:
panel cod:
<asp:Panel ID="Panel2" runat="server">
<b> Test.</b>
</asp:Panel>
balloon pop up code:
<asp:BalloonPopupExtender ID="len_BalloonPopupExtender" runat="server" BalloonPopupControlID="Panel1"
CustomCssUrl="" DisplayOnClick="False" DisplayOnMouseOver="True" DynamicServicePath=""
Enabled="True" ExtenderControlID="" TargetControlID="len" DisplayOnFocus="False"
BalloonStyle="Rectangle">
</asp:BalloonPopupExtender>
textbox code:
<asp:TextBox ID="len" onmouseout="this.BalloonPopupControlBehavior.hidePopup();" runat="server" BorderColor="#3399FF" BorderStyle="Groove" BorderWidth="2px" Width="50" AutoPostBack="true" TabIndex="2" MaxLength="4"></asp:TextBox>
And one more thing is that i use <asp:BalloonPopupExtender> not <Ajax:BalloonPopupExtender> one!
You specifying BalloonPopupControlID="Panel1", but your panel id is Panel2.
Just change it to the correct value and it will work:

My modal window is not transferring values to vb.net codebehind

I am getting the username and password to run some scripts
<act:ModalPopupExtender ID="unixLoginMPE" runat="server" TargetControlID="rdoUnix"
PopupControlID="unixPanel" BackgroundCssClass="modalBackground" CancelControlID="unixCancel" OkControlID="unixSubmit"
/>
<asp:Panel ID="unixPanel" runat="server"
CssClass="modalPopup" align="center" Style="display: none">Unix Username: <asp:TextBox ID="unixName" ClientIDMode="Static" runat="server" />
<br />
Unix Password: <asp:TextBox ID="unixPass" runat="server" ClientIDMode="Static" TextMode="Password" />
<br />
<asp:Button ID="unixCancel" runat="server" Text="Cancel" />
<asp:Button ID="unixSubmit" ClientIDMode="Static" runat="server" Text="Submit" OnClientClick="enableRDO()" />
</asp:Panel>
In my codebehind, I'm doing something like this just to test if the values have passed.
Dim UNIXPASSWORD As String = unixPass.text
Dim UNIXUSERNAME As String = unixName.Text
MsgBox(UNIXCOMPUTERNAME)
MsgBox(UNIXUSERNAME)
MsgBox(UNIXPASSWORD)
I do reference a script to enable the radio button. I asked a question to help me with that issue, it is all resolved Radio Button won't stay check if I have a modal window open up when it is selected
<script type="text/javascript">
function enableRDO() {
var cancel = document.getElementById('rdoUnix');
cancel.setAttribute('checked', 'true');
};
</script>
For some reason the values are passing just fine in Google Chrome but not in IE. I've been at this for a few hours and don't know what else to try...or search for
EDIT:
I'm still trying to attempt this. I setup up dummy text boxes which I will hide later on if I can pass to them. I'm still very lost with this...
<asp:TextBox ID="dummyUnixName" runat="server" />
<asp:TextBox ID="dummyUnixPass" runat="server" />
If you aren't performing a postback or an AJAX call, nothing will be passed to the code behind.
During debugging, Console.WriteLine can be redirected to the output window in VS; in production, it's going to go nowhere. A logging solution is often appropriate for a web application which needs to know more of what happened than which page was requested by a user (IIS logs).

ASP.NET A problem with the MultiView control

I have some asp;View controls in asp:MultiView control. The strange problem is, when I move from View3 to View4, some controls from the View3 are visible within View4. Why ? It's the first time I occur that problem
<asp:View ID="View3" runat="server">
<br />
<label id="Label1">Test</label>
<br />
<asp:Button ID="RejectButtonGrid" runat="server" Text="Erase1" OnClick="RejectButton_Click" />
<asp:Button ID="AcceptButtonGrid" runat="server" Text="Accept" OnClick="AcceptButton_Click" />
</asp:View>
<asp:View ID="View4" runat="server">
<asp:Button ID="RejectButtonDuplicates" runat="server" Text="Erase2" OnCommand="RejectButtonDuplicates_Command"/>
<asp:Button ID="AcceptButtonDuplicates" runat="server" Text="Accept" OnCommand="AcceptButtonDuplicates_Command"/>
<br />
<asp:Button ID="BackButton" runat="server" Text="Go back" OnClick="BackButton_Click"/>
</asp:View>
Buttons from View3 are visible on View4
The markup seems to be ok, I presume views 1 and 2 are working fine? Looking at the code I would expect view 3 to show two buttons "Erase1" and "Accept", and then for view 4 it should show two buttons with "Erase 2" and "Accept"...?
Why are the buttons in view 4 using the 'OnCommand' attribute instead of 'OnClick' as they do for view 3?
Maybe the controls are cached...
try cleaning the folder 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET' Files and try again...

Resources