WebBrowser.DocumentComplete fires multiple times per request? [duplicate] - c#

This question already has answers here:
WebBrowser DocumentCompleted event fired more than once
(4 answers)
Closed 7 years ago.
I have a button that has the following code
webbrowser1.Navigate(testURL);
In my event handler
private void webbrowser1_Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (e.Url.Equals(psyncBrowser.Url))
{
Console.WriteLine("Now it is really done");
MessageBox.Show("Loaded " + psyncBrowser.Url);
webbrowser1.Stop();
}
}
The console message is printed out four times!
What's happening, and how can I stop this?
I looked at that link before and it did not address my concern.
The site I am trying to use does not have any FRAMES or IFRAMES. I checked the HTML several times.
FUll HTML of Page below
<!DOCTYPE html>
<html>
<head>
<title>Hitachi ID Identity and Access Management Suite: Verify password</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta http-equiv="cache-control" content="private,no-cache,no-store,maxage=0,s-maxage=0,must-revalidate,proxy-revalidate,no-transform">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript">
// <![CDATA[
// Array of fields to process and attempt to focus on page load
document.focusFields = [ "_MYPW", null ];
// ]]>
</script>
<link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style.css?3242224743"><!--[if lte IE 8]><link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style-ie8.css?3242224743" /><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style-ie7.css?3242224743" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="all" href="docs/default/css/style-ie6.css?3242224743" /><![endif]-->
<script src="docs/default/js/en-US/lang.js?3242224743" type="text/javascript">
</script>
<script id="C_AUTHCHAIN_LOGIN:default:en-US:" src="docs/default/js/scripts.js?3242224743" type="text/javascript">
</script>
</head>
<body class="default noSide">
<a name="top" id="top"></a>
<form name="theform" method="post" action="psf.exe" autocomplete="off" id="theform">
<div id="container">
<span id="topMargin"><input id="TRANSACTION" name="TRANSACTION" type="hidden" value="C_AUTHCHAIN_LOGIN"> <!-- 81A84EBD-2CE5-4794-8341-E1828711FFBC -->
<input id="SESSDATA" name="SESSDATA" type="hidden" value="{AES}EIDgCtlm1WIHTuwgStamCgi1cvi98CgOIhXUvVy7N2o3jDv6ce5qxqTFLdgzyU+QYBoq5w064mzb174I2rLVeq1HT8Z+hzi78gSMPbDzX0CBy0/GVTAfFsXk4OR6hc/e"> <input id="SESSLENGTH" name="SESSLENGTH" type="hidden" value="600"> <input id="SKIN" name="SKIN" type="hidden" value="default"> <input id="LANG" name="LANG" type="hidden" value="en-US"> <input id="JS" name="JS" type="hidden" value="false"> <input disabled="disabled" id="currentDateTime" type="hidden" value="2015-04-22 08:05:08 "> <input alt="" class="hideIfJs" id="DEFAULT_PAGE_ACTION" name="DEFAULT_UNUSED_BUTTON.x" src="docs/pics/spacer.gif" style="border: none; height: 1px; width: 1px;" tabindex="1000" title="" type="submit">   <span id="skipNav">skip to main navigation | skip to side navigation | skip to main content</span> <!-- end #skipNav --></span><!-- end #topMargin -->
<div id="headerContainer">
<div id="header">
<div id="companyLogo">
<img src="docs/pics/company_logo.png" width="103" height="17" alt="Hitachi">
<div class="line"></div>
</div>
<div id="topButtons">
<ul>
<li><input class="submit submitIcon back" name="SUBMIT-BACK.x" title="Back" type="submit" value=""></li>
<li class="inactive"><input class="submit inactiveIcon home" disabled="disabled" name="SUBMIT-HOME.x" title="Main menu (Disabled)" type="submit" value=""></li>
<li class="inactive"><input class="submit inactiveIcon refresh" disabled="disabled" name="SUBMIT-REFRESH.x" title="Refresh (Disabled)" type="submit" value=""></li>
<li><input class="submit submitIcon logout" name="SUBMIT-LOGOUT.x" title="Logout" type="submit" value=""></li>
</ul>
</div><!-- end #topButtons -->
<div id="topMenuBar">
<div class="clearFloat"></div>
</div><!-- end #topMenuBar -->
</div><!-- end #header -->
<div id="userInfo">
<img src="docs/pics/icon_idcard.png" alt="ID" width="16" height="12"> ID: username   <img src="docs/pics/icon_user.png" alt="User" width="10" height="14"> Name: Person Name
</div>
</div><!-- end #headerContainer -->
<div id="contentScroll">
<table cellspacing="0" id="colWrap">
<tbody>
<tr>
<td id="menuCol">
<div id="menuContent"></div><!-- end #menuContent -->
</td><!-- end #menuCol -->
<td id="mainCol">
<div id="content">
<h1>Verify password <span class="selectedObj"></span></h1><br>
<input type="hidden" name="LANG" value="en-US"><input type="hidden" name="SKIN" value="default"> <span class="bold">Enter password:</span>
<table cellspacing="0" class="border">
<tbody>
<tr>
<td class="prompt" width="50%"><span>Enter password for AD:</span></td>
<td width="50%"><input class="password text" maxlength="250" name="_MYPW" type="password"></td>
</tr>
<tr class="foot">
<td colspan="2"><input class="submit" name="SUBMIT-VERIFY.x" type="submit" value="Verify password"></td>
</tr>
</tbody>
</table><input type="hidden" name="SETTABLEFIELDSDB" value=""> <input type="hidden" name="SETTABLEFIELDSCOOKIE" value="">
</div><!-- end #content -->
</td><!-- end #mainCol -->
</tr>
</tbody>
</table><!-- end #colWrap -->
</div><!-- end #contentScroll -->
<div id="footer">
<div id="footerCompany">
Company Name
</div>
<div id="footerVersion">
<b>Hitachi ID Identity and Access Management Suite</b> v8.2.7.60749
</div>
<div id="footerCopyright">
<div>
 <sup> </sup>© 2014 <a id="footerLink" href="http://Hitachi-ID.com" rel="external" target="_blank">Hitachi ID Systems, Inc.</a>
</div>
</div>
</div>
</div><!-- end #container -->
</form>
</body>
</html>

DocumentCompleted can get fired multiple times if your page uses frames. According to the MSDN documentation the event only gets fired once in pages with no frames. In pages where multiple frames are loaded, this event fires for each frame where the DownloadBegin event has fired.
If this causes a problem you could add an event handler to onload which only get fired once:
this.webBrowser1.Document.Window.AttachEventHandler("onload", delegate
{
// Defer this to make sure all possible onload event handlers got fired
System.Threading.SynchronizationContext.Current.Post(delegate
{
// try webBrowser1.Document.GetElementById("id") here
MessageBox.Show("window.onload was fired, can access DOM!");
}, null);
});

The DocumentCompleted event will fire for each frame and link referenced in the page loaded - see this question for more info.
A better alternative would be to use the Navigated event, or check the ReadyState of the browser control.
if (browser.ReadyState != WebBrowserReadyState.Complete) {
return;
}

Related

How to insert multiple rows at once to database

I want to ask how to insert multiple rows of data at once. I included the textboxes for the user to input but it only inserts the first row of data and not the second line. Here are my references below.
The first is my controller code and the second is my view page code. I am a new coder and i need to seek help for my school work. It would be best if I can solve this problem. Thank you
[HttpPost("Create2")]
public async Task<IActionResult> CreateDependent2(Dependent dependentModel)
{
if (!ModelState.IsValid)
{
return BadRequest("Parameter condition(s) are not met");
}
else if (ModelState.IsValid)
{
_context.Dependents.Add(dependentModel);
await _context.SaveChangesAsync();
return Ok(dependentModel);
}
else
{
return BadRequest("Invalid");
}
}
and here is my view code
#model TTSH_ALIVE.Models.Dependent
#using TTSH_ALIVE.ModelObjects
#{ ViewData["Title"] = "Register";
Layout = null; }
<head>
<title>Welcome - TTSH SteWARdS</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="~/images/icons/favicon.ico" />
<link rel="stylesheet" type="text/css" href="~/vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="~/fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="~/fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<link rel="stylesheet" type="text/css" href="~/vendor/animate/animate.css">
<link rel="stylesheet" type="text/css" href="~/vendor/css-hamburgers/hamburgers.min.css">
<link rel="stylesheet" type="text/css" href="~/vendor/select2/select2.min.css">
<link rel="stylesheet" type="text/css" href="~/css/util.css">
<link rel="stylesheet" type="text/css" href="~/css/main.css">
</head>
<div class="limiter">
<div class="container-login100">
<div class="wrap-login100 p-t-50 p-b-0">
<span class="login100-form-error p-t-20 p-b-45">
#ViewBag.error
</span>
<div class="jp-container" style="margin-top:20px">
<h1 class="jp-jumbo"><b>Sign Up</b></h1>
<hr style="width:80px; border:5px solid #a6192e" class="jp-round">
</div>
<div class="jp-row">
<form asp-action="CreateDependent">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="UserID" value="#ViewData["UserID"]" class="form-control" />
<div class="form-group-half">
<label asp-for="AgeOfDependent" class="text-white"></label>
<input asp-for="AgeOfDependent" class="form-control" />
<span asp-validation-for="AgeOfDependent" class="text-white"></span>
</div>
<div class="form-group-full">
<label asp-for="DependentType" class="text-white"></label><br />
<select asp-for="DependentType" class="jp-select">
<option selected disabled>---Please select a dependent type---</option>
<option>Parent</option>
<option>Child</option>
</select>
<span asp-validation-for="DependentType" class="text-white"></span>
</div>
<div class="form-group-half">
<label asp-for="AgeOfDependent" class="text-white"></label>
<input asp-for="AgeOfDependent" class="form-control" />
<span asp-validation-for="AgeOfDependent" class="text-white"></span>
</div>
<div class="form-group-full">
<label asp-for="DependentType" class="text-white"></label><br />
<select asp-for="DependentType" class="jp-select">
<option selected disabled>---Please select a dependent type---</option>
<option>Parent</option>
<option>Child</option>
</select>
<span asp-validation-for="DependentType" class="text-white"></span>
</div>
<div class="text-white">
<b>#ViewBag.message</b>
</div>
<div class="form-group-half">
<input type="submit" value="Sign Up" class="jp-btn-86" />
</div>
<div class="form-group-half">
<a asp-area="" asp-controller="Login" asp-action="Index" style="margin-top: 7px" class="login100-form-btn">Back to Login</a>
</div>
</form>
</div>
</div>
</div>
#section Scripts {
#{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}

Jquery Modal not showing on button click ASP.NET

I have a multi step form on a web page using ASP.NET. I have two features on a form I would like to use. Autosuggest on a textbox which works fine. Also when you click on a button I want it to show a modal which shows data from a gridview. Everytime I try and click on the button, the modal does not appear.
I have a button which calls a method in the back end this calls the gridview bind method and ClientScript.RegisterStartupScript to Open the Modal. When I debug it steps through but nothing happens. And no errors in the console.
I have an update panel wrapped around my button to prevent auto-postback on the button click as I dont want the page to refresh and start the form from the beginning again.
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div id="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<!-- progressbar -->
<ul id="progressbar">
<li class="active">Create Template</li>
<li>Add Recipients</li>
<li>Select Content</li>
<li>Add Style</li>
</ul>
<!-- fieldsets -->
<fieldset>
<h2 class="fs-title">Create new Template</h2>
<h3 class="fs-subtitle">Provide following information</h3>
<div id="applicationselectdiv" runat="server">
</div>
<input type="text" name="tempname" placeholder="Template Name"/>
<input type="text" name="subname" placeholder="Subject Line"/>
<input type="button" name="next" class="next action-button" value="Next"/>
</fieldset>
<fieldset>
<h2 class="fs-title">Add Recipients</h2>
<h3 class="fs-subtitle">Add multiple recipients</h3>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="viewrecpbutton" runat="server" class="btn btn-primary" Text="View Recipients" OnClick="ViewRecipient_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<div id="recipienttypediv" runat="server">
</div>
<input type="text" id="SearchInput" class="autosuggest" name="initialname" placeholder="Initials"/>
<div id="subteamdiv" runat="server">
</div>
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:Button ID="addbtn" runat="server" Text="Add" OnClick="AddRecipient_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Recipients</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" runat="server">
<asp:GridView ID="gvCurrentRecipients" runat="server" AutoGenerateColumns="true">
</asp:GridView>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<input type="button" name="previous" class="previous action-button-previous" value="Previous"/>
<input type="button" name="next" class="next action-button" value="Next"/>
</fieldset>
<fieldset>
<h2 class="fs-title">Select Content</h2>
<h3 class="fs-subtitle">This is what will appear in the email</h3>
<input type="button" name="previous" class="previous action-button-previous" value="Previous"/>
<input type="button" name="next" class="next action-button" value="Next"/>
</fieldset>
<fieldset>
<h2 class="fs-title">Add Style</h2>
<h3 class="fs-subtitle">Colour scheme</h3>
<input type="button" name="previous" class="previous action-button-previous" value="Previous"/>
<input type="submit" name="submit" class="submit action-button" value="Submit"/>
</fieldset>
</div>
</div>
</div>
</form>
protected void ViewRecipient_Click(object sender, EventArgs e)
{
GetgvRecipients();
ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openModal();", true);
}
<script type="text/javascript">
function openModal() {
$('#myModal').modal('show');
}
</script>
Order of my libraries:
<script src="Scripts/jquery-3.0.0.js"></script>
<script src="Scripts/jquery-ui-1.12.1.js"></script>
<script src="Scripts/bootstrap.min.js"></script>
<!-- Bootstrap core CSS-->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"/>
<!-- Custom styles for this template-->
<link href="css/cr-admin.css" rel="stylesheet"/>
<link href="NewTemplate.css" rel="stylesheet" />
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin.min.js"></script>
<script src="NewTemplate.js"></script>

My icons aren't properly loading

I currently work on a C#/asp.net project, and my icons are not displayed correctly any more. I say "any more" because at a moment, it worked. That lead me to think that it's not a problem of importation, but more of code (but I may be wrong). The used icons come from the libraries "font awesome" and "ionicons". As I am a newbie in HTML, I really don't know where the problem could come from : I put here the code of the html page which could be incriminated, but I am not really sure it's relevant.
#model Serene5.Common.DashboardPageModel
#{
ViewData["Title"] = "Dashboard";
ViewData["PageId"] = "Dashboard";
}
#section Head {
<link rel="stylesheet" href="~/Content/iCheck/flat/blue.css">
<link rel="stylesheet" href="~/Scripts/morris/morris.css">
<link rel="stylesheet" href="~/Scripts/jvectormap/jquery-jvectormap-1.2.2.css">
<link rel="stylesheet" href="~/Scripts/datepicker/datepicker3.css">
<link rel="stylesheet" href="~/Scripts/daterangepicker/daterangepicker-bs3.css">
<link rel="stylesheet" href="~/Scripts/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<script src="~/Scripts/raphael/raphael-min.js"></script>
<script src="~/Scripts/morris/morris.min.js"></script>
<script src="~/Scripts/sparkline/jquery.sparkline.min.js"></script>
<script src="~/Scripts/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="~/Scripts/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="~/Scripts/knob/jquery.knob.js"></script>
<script src="~/Scripts/daterangepicker/moment.min.js"></script>
<script src="~/Scripts/daterangepicker/daterangepicker.js"></script>
<script src="~/Scripts/datepicker/bootstrap-datepicker.js"></script>
<script src="~/Scripts/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="~/Scripts/adminlte/pages/dashboard.js"></script>
<script src="~/Scripts/adminlte/demo.js"></script>
}
#section ContentHeader {
<h1>#LocalText.Get("Navigation.Dashboard")<small>#Html.Raw(Texts.Site.Dashboard.ContentDescription)</small></h1>
}
<div class="row">
<!-- Small boxes (Stat box) -->
#{for (int i = 0; i < Model.ListStations.Length; i++)
{
string urlTemp = Model.ListStations[i];
string colorTemp = "small-box bg-" + Model.ListColors[i % Model.ListColors.Length];
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<!-- achtung hier soll man vielleicht die Adresse ändern -->
<div class="#colorTemp">
<div class="inner">
<h3>Station</h3>
<p> #Model.ListStations[i]</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars" aria-hidden="true"></i>
</div>
More info <i class="fa fa-arrow-circle-right"></i>
</div>;
</div>
<!-- /.row -->
}
}
</div>
<!-- Main row -->
<div class="row">
<!-- Left col -->
<section class="col-lg-7 connectedSortable">
<!-- Custom tabs (Charts with tabs)-->
<div class="nav-tabs-custom">
<!-- Tabs within a box -->
<ul class="nav nav-tabs pull-right">
<li class="active">Area</li>
<li>Donut</li>
<li class="pull-left header"><i class="fa fa-inbox"></i> Sales</li>
</ul>
<div class="tab-content no-padding">
<!-- Morris chart - Sales -->
<div class="chart tab-pane active" id="revenue-chart" style="position: relative; height: 300px;"></div>
<div class="chart tab-pane" id="sales-chart" style="position: relative; height: 300px;"></div>
</div>
</div><!-- /.nav-tabs-custom -->
</section><!-- right col -->
</div><!-- /.row (main row) -->
Here is also a screen showing how the website is currently displayed
Don't hesitate to ask for any further details, I will edit the post
Here is the html generated by the page :
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en-US" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en-US" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en-US" class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="home" id="ApplicationPath" href="/" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link href="/Content/font-open-sans.css?v=_lyM_7sDAZstbPZ6aTr8rQ2" rel="stylesheet" type="text/css"/>
<link href="/Content/font-awesome.css?v=xJVlSGl4W8PfYCFmFoFK0Q2" rel="stylesheet" type="text/css"/>
<link href="/Content/simple-line-icons.css?v=CTymYjlO1pj9tYNeQl0o3Q2" rel="stylesheet" type="text/css"/>
<link href="/Content/ionicons.css?v=8nNUsorzz0jSgmDAMwXQzg2" rel="stylesheet" type="text/css"/>
<link href="/Content/aristo/aristo.css?v=MvOjKTOOh8qSpUV6_HAAHw2" rel="stylesheet" type="text/css"/>
<link href="/Content/bootstrap.css?v=KjHcoRLyaSO1FnbLdkxY1Q2" rel="stylesheet" type="text/css"/>
<link href="/Content/colorbox/jquery.colorbox.css?v=XnRFE7k2jxZ7HVn-r2Jaww2" rel="stylesheet" type="text/css"/>
<link href="/Content/jquery.fileupload.css?v=T6JqyTNuIq_tJ7F3R_5z3g2" rel="stylesheet" type="text/css"/>
<link href="/Content/pace.css?v=L_wBl1JNKiTT55UKpioDig2" rel="stylesheet" type="text/css"/>
<link href="/Content/slick.grid.css?v=Qhl0MYjRyBVihAtJg0CyYg2" rel="stylesheet" type="text/css"/>
<link href="/Content/css/select2.css?v=qz1jk8aVr8t_14LSWpFqJA2" rel="stylesheet" type="text/css"/>
<link href="/Content/toastr.css?v=lykj60CDw5t8wg1dl5y0OA2" rel="stylesheet" type="text/css"/>
<link href="/Content/serenity/serenity.css?v=gXaUzPFBrbwXSSXwdXa1Dw2" rel="stylesheet" type="text/css"/>
<link href="/Content/site/site.css?v=9m22h6rQgsGBXJmC3nRqDw2" rel="stylesheet" type="text/css"/>
<script type="application/json" id="ScriptCulture">{"DateOrder":"mdy","DateFormat":"MM/dd/yyyy","DateSeparator":"/","DateTimeFormat":"MM/dd/yyyy HH:mm:ss","DecimalSeparator":".","GroupSepearator":","}</script>
<script type="text/javascript">window.paceOptions = { minTime: 250, ghostTime: 250, restartOnRequestAfter: 250, ajax: { trackMethods: ['GET', 'POST'], trackWebSockets: true, ignoreURLs: [] } };</script>
<script src="/Scripts/pace.js?v=evfXQgyADGar15z3wQSTJA2" type="text/javascript"></script>
<script src="/Scripts/rsvp.js?v=ueGo_q7N2s93Y-AzfUrs8A2" type="text/javascript"></script>
<script src="/Scripts/jquery-3.1.1.js?v=RoNrvGA8lWW1zAYRAMy6yA2" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.12.1.js?v=q1KE3l49Ih5TZH_TSOVkSw2" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-i18n.js?v=fAmmyIS6gdv3hjEK_SFl9Q2" type="text/javascript"></script>
<script src="/Scripts/jquery.validate.js?v=Q3Q3qwsR7Ja623fum9IuDw2" type="text/javascript"></script>
<script src="/Scripts/jquery.blockUI.js?v=pK0cWqNrGE32YMv5pAHwjQ2" type="text/javascript"></script>
<script src="/Scripts/jquery.cookie.js?v=1VKN3gAGx4vgSBcyfC-bbw2" type="text/javascript"></script>
<script src="/Scripts/jquery.json.js?v=ojEuMerciKpf9J0ukgaNyg2" type="text/javascript"></script>
<script src="/Scripts/jquery.autoNumeric.js?v=Cx_a1fBvtVV4DjFAtii2Yw2" type="text/javascript"></script>
<script src="/Scripts/jquery.colorbox.js?v=lWVLMExZxFAtnKWbSFmEUQ2" type="text/javascript"></script>
<script src="/Scripts/jquery.dialogextendQ.js?v=q4CdCMYs_hImIJk7B7KATg2" type="text/javascript"></script>
<script src="/Scripts/jquery.event.drag.js?v=Q42_cWjms19Czv7rSFThUg2" type="text/javascript"></script>
<script src="/Scripts/jquery.scrollintoview.js?v=j4tgWM1381VKsGUok8so9w2" type="text/javascript"></script>
<script src="/Scripts/select2.js?v=mb-susqgC8W2T0C4V7rb5g2" type="text/javascript"></script>
<script src="/Scripts/sortable.js?v=BBvydRU72CWAGeMpFpM-_Q2" type="text/javascript"></script>
<script src="/Scripts/toastr.js?v=gOnkqpQBPIBBWDh-h2vjsg2" type="text/javascript"></script>
<script src="/Scripts/SlickGrid/slick.core.js?v=BLCRBDx7U3jsEuDNgnEQkw2" type="text/javascript"></script>
<script src="/Scripts/SlickGrid/slick.grid.js?v=f5lvq3M8mdFxwZoSgj7E8w2" type="text/javascript"></script>
<script src="/Scripts/SlickGrid/slick.groupitemmetadataprovider.js?v=RUFU1x9TDSkyvChFWteLsA2" type="text/javascript"></script>
<script src="/Scripts/SlickGrid/Plugins/slick.autotooltips.js?v=-AIKLINWiZmkA-CnhA5ZRQ2" type="text/javascript"></script>
<script src="/Scripts/SlickGrid/Plugins/slick.headerbuttons.js?v=9YOWFAIrd9_PYSbDwFxdqg2" type="text/javascript"></script>
<script src="/Scripts/bootstrap.js?v=-4FUnuKJZROh7VcUsbGg8A2" type="text/javascript"></script>
<script src="/Scripts/saltarelle/mscorlib.js?v=AO_L_1E_BHK8K8k5pu8Fmg2" type="text/javascript"></script>
<script src="/Scripts/serenity/Serenity.CoreLib.js?v=1L8198NTwiEN0tbBJm4szw2" type="text/javascript"></script>
<script src="/Scripts/serenity/Serenity.Script.UI.js?v=FGT2MLhQAFXM0w_Ybxe0AQ2" type="text/javascript"></script>
<script src="/Scripts/jquery.cropzoom.js?v=ju9wbWcKr48aWqD5qkXCcQ2" type="text/javascript"></script>
<script src="/Scripts/jquery.fileupload.js?v=e-hGpVezhrzCNo0tj4bR2A2" type="text/javascript"></script>
<script src="/Scripts/jquery.iframe-transport.js?v=mCjCNWoMY71LgLOhwmmOGQ2" type="text/javascript"></script>
<script src="/Scripts/jquery.maskedinput.js?v=HN6v6EEgtiHc2VNZKpTJmA2" type="text/javascript"></script>
<script src="/Scripts/jquery.slimscroll.js?v=buWrXYmFe-bq8Itj6zJGsA2" type="text/javascript"></script>
<script src="/Scripts/SlickGrid/Plugins/slick.rowselectionmodel.js?v=XribFqTCdkXWmUfvTfmwMw2" type="text/javascript"></script>
<script src="/Scripts/mousetrap.js?v=LZ3oO7G3uh_XrsUxuoHUpA2" type="text/javascript"></script>
<script src="/Scripts/fastclick/fastclick.js?v=bp07DadPKkpwQrSUzap8Lg2" type="text/javascript"></script>
<script src="/Scripts/adminlte/app.js?v=sEFfHWOWYAV53y-2WWKVgw2" type="text/javascript"></script>
<script src="/Scripts/Site/Serene5.Web.js?v=MWzcm5FC-dWRLpEqVuzDwg2" type="text/javascript"></script>
<script src="/DynJS.axd/LocalText.Site.en-US.Public.js?v=TAg9qLhz34DPI6z4guBgog2"></script>
<script src="/DynJS.axd/ColumnsBundle.js?v=t0XeZZg0HS5LnLTkazC9fw2"></script>
<script src="/DynJS.axd/FormBundle.js?v=F99UAnyx4Xtee88SQxRi1A2"></script>
<script src="/DynJS.axd/TemplateBundle.js?v=q6ePJcfaBGdWeEuYVsIJHA2"></script>
<script src="/DynJS.axd/RegisteredScripts.js?v=c25aIR1HyiCXuBpDAHMSdQ2"></script>
<link rel="stylesheet" href="/Content/iCheck/flat/blue.css">
<link rel="stylesheet" href="/Scripts/morris/morris.css">
<link rel="stylesheet" href="/Scripts/jvectormap/jquery-jvectormap-1.2.2.css">
<link rel="stylesheet" href="/Scripts/datepicker/datepicker3.css">
<link rel="stylesheet" href="/Scripts/daterangepicker/daterangepicker-bs3.css">
<link rel="stylesheet" href="/Scripts/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<script src="/Scripts/raphael/raphael-min.js"></script>
<script src="/Scripts/morris/morris.min.js"></script>
<script src="/Scripts/sparkline/jquery.sparkline.min.js"></script>
<script src="/Scripts/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="/Scripts/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="/Scripts/knob/jquery.knob.js"></script>
<script src="/Scripts/daterangepicker/moment.min.js"></script>
<script src="/Scripts/daterangepicker/daterangepicker.js"></script>
<script src="/Scripts/datepicker/bootstrap-datepicker.js"></script>
<script src="/Scripts/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="/Scripts/adminlte/pages/dashboard.js"></script>
<script src="/Scripts/adminlte/demo.js"></script>
<title>Dashboard - Serene5</title>
</head>
<body id="s-DashboardPage" class="fixed sidebar-mini hold-transition skin-blue has-layout-event">
<div class="wrapper">
<header class="main-header">
<a href="/" class="logo">
<span class="logo-mini"><i></i></span>
<span class="logo-lg"><i></i><b>Serene5</b></span>
</a>
<nav class="navbar navbar-static-top" role="navigation">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="/Content/adminlte/img/avatar04.png" class="user-image" alt="User Image">
<span class="hidden-xs">admin</span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<img src="/Content/adminlte/img/avatar04.png" class="img-circle" alt="User Image">
<p>
admin
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<i class="fa fa-lock fa-fw"></i> Change Password
</div>
<div class="pull-right">
<i class="fa fa-sign-out fa-fw"></i> Logout
</div>
</li>
</ul>
</li>
<li>
<i class="fa fa-gears"></i>
</li>
</ul>
</div>
</nav>
</header>
<aside class="main-sidebar">
<section class="sidebar">
<form action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" id="SidebarSearch" name="q" class="form-control" autocomplete="off">
<span class="input-group-btn">
<button type="button" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
<ul class="sidebar-menu" id="SidebarMenu">
<li class="active">
<a href="/">
<i class="nav-icon fa icon-speedometer"></i>
<span>Dashboard</span>
</a>
</li>
<li class=" treeview">
<a href="javascript:;">
<i class="nav-icon fa icon-screen-desktop"></i>
<span>Administration</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li class="">
<a href="/errorlog.axd"_blank target=_blank>
<i class="nav-icon fa icon-ban"></i>
<span>Exceptions Log</span>
</a>
</li>
<li class="">
<a href="/Administration/Language">
<i class="nav-icon fa icon-bubbles"></i>
<span>Languages</span>
</a>
</li>
<li class="">
<a href="/Administration/Translation">
<i class="nav-icon fa icon-speech"></i>
<span>Translations</span>
</a>
</li>
<li class="">
<a href="/Administration/Role">
<i class="nav-icon fa icon-lock"></i>
<span>Roles</span>
</a>
</li>
<li class="">
<a href="/Administration/User">
<i class="nav-icon fa icon-people"></i>
<span>User Management</span>
</a>
</li>
</ul>
</li>
<li class=" treeview">
<a href="javascript:;">
<i class="nav-icon fa icon-layers"></i>
<span>Default</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li class="">
<a href="/Default/TcpDump">
<i class="nav-icon fa fa-circle-o"></i>
<span>TcpDump</span>
</a>
</li>
<li class="">
<a href="/Default/Errors">
<i class="nav-icon fa fa-circle-o"></i>
<span>Errors</span>
</a>
</li>
<li class="">
<a href="/Default/Regeln">
<i class="nav-icon fa fa-circle-o"></i>
<span>Regeln</span>
</a>
</li>
</ul>
</li>
<script type="text/javascript">
function openWindow(url, width, height) {
height = height || (screen.availHeight - 60);
width = width || (screen.availWidth - 10);
var x = (screen.availWidth - width) / 2 - 5; if (x < 0) x = 0;
var y = (screen.availHeight - height) / 2 - 25; if (y < 0) y = 0;
var winPopup = window.open(url, "", "status=0, toolbar=0, width=" + width + ", height=" + height +
", scrollbars=1, resizable=yes, left=" + x + ", top=" + y);
}
</script>
</ul>
</section>
</aside>
<div class="content-wrapper">
<section class="content-header">
<h1>Dashboard<small>a sample with random data (from free <em>AdminLTE theme</em>)</small></h1>
</section>
<section class="content">
<div class="row">
<!-- Small boxes (Stat box) -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<!-- achtung hier soll man vielleicht die Adresse ändern -->
<div class="small-box bg-blue">
<div class="inner">
<h3>Station</h3>
<p> Station1</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars" aria-hidden="true"></i>
</div>
More info <i class="fa fa-arrow-circle-right"></i>
</div>;
</div>
<!-- /.row -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<!-- achtung hier soll man vielleicht die Adresse ändern -->
<div class="small-box bg-black">
<div class="inner">
<h3>Station</h3>
<p> Station2</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars" aria-hidden="true"></i>
</div>
More info <i class="fa fa-arrow-circle-right"></i>
</div>;
</div>
<!-- /.row -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<!-- achtung hier soll man vielleicht die Adresse ändern -->
<div class="small-box bg-green">
<div class="inner">
<h3>Station</h3>
<p> Station3</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars" aria-hidden="true"></i>
</div>
More info <i class="fa fa-arrow-circle-right"></i>
</div>;
</div>
<!-- /.row -->
</div>
<!-- Main row -->
<div class="row">
<!-- Left col -->
<section class="col-lg-7 connectedSortable">
<!-- Custom tabs (Charts with tabs)-->
<div class="nav-tabs-custom">
<!-- Tabs within a box -->
<ul class="nav nav-tabs pull-right">
<li class="active">Area</li>
<li>Donut</li>
<li class="pull-left header"><i class="fa fa-inbox"></i> Sales</li>
</ul>
<div class="tab-content no-padding">
<!-- Morris chart - Sales -->
<div class="chart tab-pane active" id="revenue-chart" style="position: relative; height: 300px;"></div>
<div class="chart tab-pane" id="sales-chart" style="position: relative; height: 300px;"></div>
</div>
</div><!-- /.nav-tabs-custom -->
</section><!-- right col -->
</div><!-- /.row (main row) -->
</section>
</div>
<footer class="main-footer">
<div class="pull-right hidden-xs">
Serenity Platform
</div>
<strong>Copyright (c) 2015.</strong> All rights reserved.
</footer>
<aside class="control-sidebar control-sidebar-dark">
<div class="tab-content">
<div class="tab-pane active" id="control-sidebar-settings-tab">
<form method="post">
<h3 class="control-sidebar-heading">General Settings</h3>
<div class="form-group">
<label class="control-sidebar-subheading">Language</label>
<select id="LanguageSelect" class="form-control"></select>
</div>
<div class="form-group" style="margin-top: 15px;">
<label class="control-sidebar-subheading">Theme</label>
<select id="ThemeSelect" class="form-control"></select>
</div>
</form>
</div>
</div>
</aside>
<div class="control-sidebar-bg"></div>
</div>
<script type="text/javascript">
$().ready(function () {
new Serene5.Common.SidebarSearch($('#SidebarSearch'), $('#SidebarMenu')).init();
new Serene5.Common.LanguageSelection($('#LanguageSelect'), 'en-US');
new Serene5.Common.ThemeSelection($('#ThemeSelect'));
;
var doLayout = function () {
height = (this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height;
height -= $('header.main-header').outerHeight() || 0;
height -= $('section.content-header').outerHeight() || 0;
height -= $('footer.main-footer').outerHeight() || 0;
if (height < 200) height = 200;
$("section.content").css("min-height", (height) + "px");
$('body').triggerHandler('layout');
};
$(window).bind("load resize layout", doLayout);
doLayout();
});
</script>
</body>
</html>
note : Here is an excerpt of the debug console
"iisexpress.exe" (CLR v4.0.30319: DefaultDomain): "C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll" geladen. Das Laden von Symbolen wurde übersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert.
"iisexpress.exe" (CLR v4.0.30319: DefaultDomain): "C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" geladen. Das Laden von Symbolen wurde übersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert.
"iisexpress.exe" (CLR v4.0.30319: DefaultDomain): "C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" geladen. Das Laden von Symbolen wurde übersprungen. Das Modul ist optimiert, und die Debugoption "Nur eigenen Code" ist aktiviert.
(Sorry for german). "Das Laden von Symbolen wurde übersprungen" means "the load of symbols has been skipped"
As mentioned in the very first response, what is the path of your font-awesome font files?
They need to be in the same place as the font-awesome CSS file expects them to be.
To determine what path is being used, using Google Chrome, press Ctrl + Shift + J or use the options menu > More Tools > Developer Tools. Navigate to the Network tab and you will be able to see a row relating to loading the fonts resource as well as a Status code (404 not found, 200 good).

Dynamically add the rows in table

Suppose we select the row in gridview then we get the one number from gridview. Suppose we get 8 number from gridview then how to add the Eight rows in html table with textboxes. is it possible, and how it use with jquery .append(), Thanks in Advance.
I am not sure that I understand the question properly, but yes it is possble and very simple with jquery. Your script should look something like:
function appendTable(numberOfRows) {
var row = '<tr><td><input type="text" class="yourInput"></td></tr>'; //you should change this for your needs
for (var i = 0; i < numberOfRows; i++) {
$('#yourTable').append(row);
}
}
Here is a complete example for add row and remove row :
<!DOCTYPE html>
<html>
<head>
<title>Add / Remove Row</title>
<link rel="stylesheet" type="text/css"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script type="text/javascript"
src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".btn-add").on('click', function() {
var singleRow = $(".singleRow").eq(0).clone();
singleRow.find('.btn-add')
.removeClass('btn-succcess')
.addClass('btn-danger')
.removeClass('btn-add')
.addClass('remove')
.html("X");
singleRow.find('input').each(function(i, input) {
$(input).val('');
});
$("#wrapper").append(singleRow);
});
$(document).on('click', ".remove", function() {
$(this).parent().remove();
});
});
</script>
<style type="text/css">
.singleRow {
padding: 10px 0;
}
</style>
</head>
<body>
<div class="container">
<form role="form" autocomplete="off" id="wrapper">
<div class="row singleRow">
<div class="col-md-3">
<input class="form-control" name="name[]" type="text">
</div>
<div class="col-md-3">
<input class="form-control" name="phone[]" type="text">
</div>
<div class="col-md-1">
<select name="opt[]" class="form-control">
<option>1</option>
<option>2</option>
</select>
</div>
<button type="button" class="btn btn-success btn-add">
+
</button>
</div>
</form>
</div>
</body>
</html>

System.Web.HttpException: Section not defined

I have the following _Layout.cshtml:
#using System.Web.Optimization
<!DOCTYPE html>
<html>
<head>
<title>Structured Content </title>
<link href="~/Content/Site.css" rel="stylesheet" type="text/css" />
#Scripts.Render("~/bundles/jquery")
</head>
<body>
<div id="layout">
<div id="header">
<div class="menu_header">
<h2 style="float: left;">Logo</h2>
#RenderSection("menu_header");
</div>
</div>
<div id="bottom_menu">
</div>
<div id="media">
#RenderSection("media");
</div>
<div id="content">
<div id="maincontent">
#RenderBody();
</div>
</div>
<div id="footer">
Foooter
</div>
</div>
#RenderSection("scripts", required: false)
</body>
</html>
In my index.cshtml, I have the following:
#{
Layout = "../Shared/_Layout.cshtml";
}
#section menu_header {
<div class="login_menu_links">
<ul>
<li>
Top ranked▼
</li>
</ul>
</div>
<div class="sign_in_style">
<form>
<span style="display:inline-block">
<label>Email</label><br/>
<input type="text" name="email">
</span>
<span style="display:inline-block">
<label>Password</label><br/>
<input type="password" name="pass">
<input type="submit" name="submit" value="Log in">
</span>
</form>
</div>
}
#section media {
<img src="https://marshallamps.com/wp-content/themes/marshallamps/images/brand-video-overlay.jpg" width="755">
<img src="https://www.marshallheadphones.com/media/upload/pressimages/marshall/MIXEDMEDIA/EVENT/instac.jpg">
<img src="http://blog.weddingfavorsbynette.com/wp-content/uploads/2013/05/wedding-music-dj-624x416.jpg" width="498">
}
<div id="leftcontent">
<h2 class="news_title">Get discovered as a band or musician<br />here on Namn. </h2>
<ul class="info_text">
<li><img src="https://cdn3.iconfinder.com/data/icons/vote/16/medal_star_rank-512.png" width="30" height="30">Gather karma points - get ranked</li>
<li><img src="http://findicons.com/files/icons/770/token_dark/128/headphones.png" width="32" height="32">Explore new music - all genres</li>
<li><img src="https://cdn3.iconfinder.com/data/icons/gray-user-toolbar/512/social_network-512.png" width="30" height="30">Connect - with musicians and friends</li>
</ul>
</div>
<script type="text/javascript">
$('#top_ranked_menu').mouseover(function () {
$('#bottom_menu').show();
});
$('#bottom_menu').mouseout(function () {
$(this).hide();
});
</script>
When I run my application, I get the following error message:
Section not defined: "menu_header".
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Section not defined:
"menu_header".
As I can see, I have defined them?

Categories