How to initialize any logger at one place to use it in multiple controller

Member Avatar
+0 forum 0

Previously the program was written on VS2005, now I use VS2010 to run the program normally but when I publish the web site I get an error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. error CS0433: The type 'webapp4U.UI.Controls.Controls_MenuLeft' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\nhadat\42a77785\d1e96df3\App_Web_danhmucbds.ascx.cc671b29.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\nhadat\42a77785\d1e96df3\App_Web_quangcaoleft.ascx.cc671b29.dll'...

Member Avatar
+0 forum 0

DataSet ds = new DataSet(); string pattern = @"(</?)(\w+:)"; //[XMLText] is a string variable containing XML downloaded from a WebServices API. StringReader sr = new StringReader(Regex.Replace(XMLText, pattern, "$1")); ds.ReadXml(sr); return ds;

Member Avatar
-1 forum 0

Hello to you all. I want to import an excel with four spreadsheets into 4 grid views. So far so good. But I also wan the grid view on load to check if the line values already exist on the database. What's the best apprach to add this collumn to the grid view? Regards, RL

Member Avatar
+0 forum 0

Hello, [Click Here](https://i.imgur.com/47YUdmn.png) My problem is in the Edit view, it gets all the information except the logo.. my edit get controller is : // GET: Billers/Edit/5 public ActionResult Edit(string id, HttpPostedFileBase logo) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Biller biller = db.Billers.Find(id); if (biller == null) { return HttpNotFound(); } return View(biller); } ///THE VIEW <div class="form-group"> @Html.LabelFor(model => model.Logo, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> <!--<input type="file" class="form-control" name="logo" accept="image/png,image/jpg,image/jpeg" />--> @Html.EditorFor(model => model.Logo, new { htmlAttributes = new { @class = "form-control", type = "file", accept = "image/x-png, image/gif, …

Member Avatar
+0 forum 0

Suppose I create an asp.net website project that loads data into griview from the class library, declaring the library to use loading data for griview //file: ChitietSP.aspx using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Diagnostics; // Debug using connectSQL; // warning public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadData(); } } string sSQL; private void LoadData() { sSQL = "SELECT * FROM TABKHACHHANG "; sSQL += "ORDER BY MASOPHIEU;"; GridView1.DataSource = ClsConnecSQL.FillDatatable(sSQL); //warning } } //file: …

Member Avatar
+0 forum 0

i have made leaves managment system ,now i want to mentioned leaves days in attendance register if employee take leave from 1-1-2019 to 4-1-2019 then 5 day display in attendance register as a (L) . kindly guide me how it will get done. here is my attendance register query in pivot table. SELECT DISTINCT ReportingDate INTO #Dates FROM EmployeesAttendance WHERE (ReportingDate BETWEEN @StartDate AND @Enddate) ORDER BY ReportingDate DECLARE @cols NVARCHAR(4000) SELECT @cols = COALESCE(@cols + ',[' + CONVERT(varchar, DATEPART(DAY, ReportingDate), 112) + ']','[' + CONVERT(varchar,DATEPART(DAY, ReportingDate), 112) + ']') FROM #Dates ORDER BY ReportingDate -- Building the query with …

Member Avatar
+0 forum 0

Hi All, My first post in a LONG time (got a prompt from admin). I have a fully working ASP.Net website that handles dimensions in metric. The customer now wants to extend the website to allow Americans to use it using imperial measurements!!!?? (Yes, I have tried to talk them out of it!). I think the way to do this would be to keep everything in metric as far as possible and convert to imperial (feet & inches instead of metres) on the fly. So, when displaying the values I convert from metres to feet/inches After accepting input I convert …

Member Avatar
+0 forum 0

SummaryProblem ============= How to get label text from table reference on database based on TableName and FieldName dynamically from database and show on view createEmployee . Details Problem Meaning i need to get label text dynamically from database not static from model SO that Every Time i need to change text of label i will change it from database depend on reference table AND No need to change from code . ===============Goal From I post I need function or any thing general let me get text of label from database because Title of labels on my suituation changed more) ===============Tools …

Member Avatar
+0 forum 0

why was error Could not find schema information for the element 'http://schemas.microsoft.com/.NetConfiguration/v2.0:configuration' ? you see attach file http://www.mediafire.com/file/jimpgxd88zzfnab/BookShopOnline.rar/file and see file pictures http://www.mediafire.com/view/67di18r0ea4dadg/errorwebconfig.jpg/file

Member Avatar
+0 forum 0

Hi here is code snippet used temprarily on button to debug. This works but i wish to use the 2nd snippet. 1st snippet Dim connString As New SqlConnection connString.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("sql2008r2_857000_dmcsqlConnectionString").ConnectionString Dim cmd As New SqlCommand("select TOP 1 no from members ORDER BY no DESC", connString) Dim reader As SqlDataReader Dim lastNumber As String Using (connString) connString.Open() reader = cmd.ExecuteReader() While reader.Read lastNumber = reader.Item("no") End While End Using Response.Write(lastNumber) 2nd snippet Dim connString As New SqlConnection connString.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("sql2008r2_857000_dmcsqlConnectionString").ConnectionString Dim cmd As New SqlCommand("select max(no) from members ", connString) Dim reader As SqlDataReader Dim lastNumber As String Using (connString) …

Member Avatar
+0 forum 0

Here I present a WebSite containing just Default.aspx. Current snippet code has to do with coloring text in an input field of a web page. The input field is an editable DIV HTML element. While the user writes, there is a partial post (an XMLHttpRequest) to the server. Then the code behind decides which parts of the input should be colored and which color should it be, and returns back to the client the input already formatted with color(s). The code behind must be as fast as possible to interfere as less as possible the user input. After the formatted …

Member Avatar
+0 forum 0

Am a noob to sitecore and learning it .. i have created a webpage from the content editor in sitecore also has paralel webpage in asp.net c# but when i navigate it says document not found !!.. And pops as to check the appropriate prefix added IgnoreUrlPrefixes in webconfig .. can someone help me out as the page is under sitecore procree then how i ignore the url .. please advise ..

Member Avatar
+0 forum 0

Hello Everyone, I am building multi-web application pages using the Default.aspx, Default.aspx.cs and Confirm.aspx and Confirm.aspx.cs. The problem that I am having is that when I click "Confirm" before clicking "Calculate," the event handler displays the "Click the Calculate button before the confirm" at the bottom of the page. It does that even if the Calculate button is clicked before the Confirm and also displays again when I reload the page. How can I get this to only display if the session state value of SalesPrice is null? Otherwise, it will redirect to the confirm page. Here is Default.aspx.cs: using …

Member Avatar
+0 forum 0

Hi, Currently, I am stuck with this problem whereby I do not know how to make my text disappear with a click of radio button event. To start with, the data is being drawn out using Store Procedure and the data appeared inside the textboxes when user selected a item in a dropdownlist. But, I need to make the text go away if user decided to press on a radio button say Yes. Any tips on how to do this kind of code would be most appreciated. Tks.

Member Avatar
+0 forum 0

Hi I am using Product Table. I choise Category DropDownList after page is postback and I choise checkbox and I choise another DropdownList after page is postback and I lost value Checkbox Checked. How can I do example. <asp:DropDownList ID="drpKategori" Style="width: 25%" CssClass="form-control" runat="server" OnSelectedIndexChanged="drpKategori_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList> </div> <div class="form-group"> <asp:Button ID="addRow" runat="server" Text="Yeni Satır" /> <asp:GridView ID="example" CssClass="table table-striped table-bordered table-hover" AutoGenerateColumns="false" runat="server" ClientIDMode="Static" OnPreRender="example_PreRender" OnRowEditing="example_RowEditing" OnRowCancelingEdit="example_RowCancelingEdit" OnRowDeleting="example_RowDeleting" OnRowDataBound="example_RowDataBound"> <Columns> <asp:TemplateField HeaderText="Ürün Seç" ItemStyle-Width="50"> <HeaderTemplate> <asp:CheckBox ID="chkAll" runat="server" onclick="checkAll(this);" /> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chcsec" CssClass="form-control" runat="server" onclick="Check_Click(this);" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Ürün Ad" ItemStyle-Width="100"> <ItemTemplate> <asp:Label ID="lblUrun" runat="server" Text='<%# Eval("UrunAd") …

Member Avatar
+0 forum 0

** edit http post i need to remove courses stored in ids variable note i need remove courses selected not edit** in jquery i store values of removed courses in ids variable suppose i removed photoshop and flash it will store value of 3,4 in ids variable below code when click remove it save values of courses removed in variable ids as array $("#tb").on("click", ".r", function () { $(this).parent().parent().hide(); $(this).parent().prev().prev().find("input").addClass("remove"); var ids = []; var i = 0; $(".remove").each(function () { ids[i] = $(this).val(); i++; }); for (var k = 0; k < ids.length; k++) { alert(ids[k]); } }); i …

Member Avatar
+0 forum 0

**Problem** when remove any course from table list html his position in center or first it make problem in index in database **Details** IF I have list of courses as following : Delphi Flash Photoshop IF I remove flash by JQUERY remove button then click save button it delete flash and Photoshop because there are wrong in delete courses by using remove function in jquery if i remove php it is working without any problem because it is last item suggestion using map function when remove but how to do that if there are any solution for that without using …

Member Avatar
+0 forum 0

Hi all, I have a web application written in ASP.NET. All is working ok, except that I would like to compress the data being returned. The data is basically a List of custom models. Currently I do something like: `HttpResponseMessage json = Request.CreateResponse(HttpStatusCode.OK, my_models_list);` and return this from the method. How can I compress this? I do not have access to the server, so I can't change anything with the IIS server configuration. Thanks.

Member Avatar
+0 forum 0

Needs save name in employee table and save all courses in employee courses table when click submit button in edit [HTTPPOST] Problem summary submit button save changes only and delete data exist before Problem details when click submit button in edit post .courses will save what i added or selected courses before click submit it will save but courses that employee have before will delete Example 1- i add employee name MEDO have course c++ 2-in edit view it show c++ 3-if i add python in edit view then click submit it must have two courses c++ and python 4- …

Member Avatar
+0 forum 0

I am making a website using vb .net I have a datalist which has a datatable and delete button. the output llooks some thing like this below. 'X' is the delete button. --------------------- | X name1 | X name3 | | X name2 | X name4 | --------------------- When user click on the delete button(X) i want to get the id of that button and use that to delete a record in database. <asp:DataList ID="DataList1" runat="server" RepeatColumns="3" RepeatLayout="Table" DataKeyField="ID" OnDeleteCommand="DataList1_DeleteCommand"> <ItemTemplate> <asp:ImageButton ID="imgdeletebtn" ImageUrl="x-icon.png" runat="server" /> <%# DataBinder.Eval(Container.DataItem, "StringValue") %> </ItemTemplate> </asp:DataList> Protected Sub DataList1_DeleteCommand(ByVal source As Object, ByVal e …

Member Avatar
+0 forum 0

How to create a datalist table layout in vb? I am using vb .net I have a following data: DataBase: databaseName Table : tableName -------------------- | ID | randomNames | -------------------- | 1 | name1 | | 2 | name2 | | 3 | name3 | | 4 | name4 | | 5 | name5 | | 6 | name6 | -------------------- I want to take all the data from database and display datalist table in the following format. ------------------------ |name1 | name2 | name3 | |name4 | name5 | name6 | ------------------------ I set up the code but having …

Member Avatar
+0 forum 0

i have a wcf service running, the problem am facing is how do i use the wcf to connect to the client and generate reports. if am no a wrong path please help thank

Member Avatar
+0 forum 0

I am using VB. How to select mult iteams in listbox using backend code? I have a listbox where user can select muti items. <asp:ListBox ID="lb" SelectionMode="multiple" runat="server" DataValueField="dv"> <asp:ListItem>red r</asp:ListItem> <asp:ListItem>blue b</asp:ListItem> <asp:ListItem>green g</asp:ListItem> </asp:ListBox> How can I set so the value of "blue b" and "green g" is already selected? I tried setSelected but this method is not supported. lb.SetSelected(1, True) lb.SetSelected(2, True) I also tried this below which kind of works. It does select 1 value but I need to able to select multi values. lb.Text = "blue b" lb.Text = "green g" I tried this also …

Member Avatar
+0 forum 0

I am using VB User can select the date by the following code. and date is display in textbox. <asp:TextBox ID="dateTB" runat="server" /> <asp:ImageButton ID="ib" ImageUrl="/calendar.png" ImageAlign="Bottom" runat="server" /> <asp:CalendarExtender ID="Cal1" PopupButtonID="ib" runat="server" TargetControlID="dateTB" Format="MM/dd/yyyy"> </asp:CalendarExtender> after that I am storeing that data in SQL Server database. Problem: when user doesn't enter a date than SQL Server is storing 1/1/1900 as defualt. What can I do so if user leaves a empty date field than SQL Server doesn't store 1/1/1900? What I have try: what if I check to see is dateTB is empty. if its empty than do something …

Member Avatar
+0 forum 0

Hi Sir I have a problem in passing value from Popop to main page I am using Master page and aspx page From main page, i can open popup windows and populate data in gridview. I am selecting date and capture the valeu in TextBox. When I click the button nothing happened. It shows popup windows only.. Pls advise me Thank you. Maideen It is my Code - Popup <body> <form id="form1" runat="server"> <asp:Label ID="Label1" runat="server" Text="Select Item Name"></asp:Label> <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox> <asp:Button ID="btnSearch" runat="server" Text="Search" /> <asp:TextBox ID="txtItemName" runat="server"></asp:TextBox> <asp:Button ID="btnSelectItem" runat="server" Text="select Item" OnClientClick="SetName();" /> <div> <script type="text/javascript"> …

Member Avatar
+0 forum 0

I have an input field which is showing vulnerable in security scan using XSS attack as: STYLE="xss:e/**/xpression(try{a=firstTime}catch(e){firstTime=1;alert(969)});" Could you please suggest how can we prevent from vulnerability like this ? Field: <input id="{ControlItemUniqueID}Data" style="width:150px" name="{ControlItemUniqueName}" type="hidden" {MaxLength}{IsEnabled} {IsReadOnly} class="datatext {CssClass}" value="{Data}" onkeypress="sanitizeEmployeeDateData()" onmouseover="sanitizeEmployeeDateData()" onblur="sanitizeEmployeeDateData()> <script> function sanitizeEmployeeDateData() { var EmployeeDate = document.getElementById('LIC1_EmployeeDateData'); if (EmployeeDate != null) { var date = new Date(); var d = date.getDate(); var day = (d < 10) ? '0' + d : d; var m = date.getMonth() + 1; var month = (m < 10) ? '0' + m : m; var yy = date.getYear(); …

Member Avatar
+0 forum 0

Hi. How can i populate asp:treeview only child populate with database query like "select databasename from databse where user_id="45" " and show these database in child treeview.Here is image [image]( tinypic.com/view.php?pic=15cyaew&s=9) I want "Database" remain same and blow child "Database Name",,only 1st 3 records replace with "Database Name" shown just,Kindly tell me how can i do this,Thanks.I search on google but i can't find this.Thanks. I'm working on database project.I'm using visual studio 2010,ASP.NET,C# (web)

Member Avatar
+0 forum 0

Hi, hope somebody can help me with my problem. I am using ajax validatorcalloutextender in an employee insert/update page(ASP.NET, VB.NET). I am also using bootstrap navigation tabs to group relevant employee details. Whenever there is an error in one of the fields, I would like the tab containing the field to be opened. Right now it's going to the first tab. Please help.. TIA!

Member Avatar
+0 forum 0

My Visual Studin 2010 suddenly showing nbsp symbol for the html designer. how do i disable it.

Member Avatar
+0 forum 0

The End.