Category : asp.net

I have a maybe simple problem but I don`t have that much experience with scripts: I have this Skript in my _Layout.cshtml: <script> $(‘button’).click(function () { $(this).prop(‘disabled’, true); }); </script> and one of my views: @using (Html.BeginForm("Create", "Home", FormMethod.Post, null)) { @Html.AntiForgeryToken() <div class="mt-5 d-flex flex-row"> <textarea class="form-control" name="TextArea"></textarea> <button class="btn btn-secondary btn-block mt-2 post-btn" ..

Read more

I have a custom CompositeControl which implements IScriptControl (that I put together years ago) that just started giving me javascript errors when I added the control to a new page. The control is a MultiStateCheckBox, which uses different images to represent different states for the control. I’m putting the control in a DataGrid, but the ..

Read more

I have the following code: function OnClientLoad(sender, args) { $telerik.$(sender.get_inputElement()).on(‘keyup’, function (e) { var autoComplete = $find("<%= RadAutoCompleteBox1.ClientID %>"); var contents = autoComplete.get_inputElement(); var oe = contents.value document.getElementById(‘hdnParameter’).value = oe; } } <telerik:RadAutoCompleteBox RenderMode="Lightweight" runat="server" ID="RadAutoCompleteBox1" ClientID="RadAutoCompleteBox1" autopostback="true" DataSourceID="SqlDataSource1" DataTextField="edesc" DataValueField="ecode" InputType="Token" Width="100%" Visible="true" AllowCustomEntry = "false" DropDownWidth="300px" OnClientLoad="OnClientLoad" > </telerik:RadAutoCompleteBox> <asp:SqlDataSource runat="server" ID="SqlDataSource1" CancelSelectOnNullParameter="False" ..

Read more

I have a master page that contains the following section: <section id="content"> <asp:HiddenField ID="MasterHidden" runat="server" /> <asp:ContentPlaceHolder ID="Content" runat="server" /> </section> This master page has two child pages. In one of the child pages is a GridView that contains an image button: <dx:BootstrapGridViewDataColumn Caption="Requirements" FieldName="Requirements" VisibleIndex="5"> <DataItemTemplate> <asp:ImageButton runat="server" ID="RequirementsBtn" OnClientClick="setMasterFieldValue()"/> </DataItemTemplate> </dx:BootstrapGridViewDataColumn> When the ..

Read more

I have a set of KPI data I need to pass over to a Javascript file from my ASP.NET project. I thought I could do so using a ViewBag… Here is what is in the controller: public ActionResult KPI() { if (Session["OrganizationID"] == null) { return RedirectToAction("Unauthorized", "Home"); } else { int orgId; int.TryParse(Session["OrganizationID"].ToString(), out ..

Read more