webforms

Error on adding <script> to master page

亡梦爱人 提交于 2020-01-07 07:09:05
问题 I have a Master page that have these ContentPlaceHolder : <asp:ContentPlaceHolder ID="title" runat="server"> </asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="contentTitle" runat="server" ></asp:ContentPlaceHolder> <asp:ContentPlaceHolder ID="content" runat="server"> </asp:ContentPlaceHolder> when I add these codes for jquery in <head> part of master page: <script type="text/javascript" src="script/jquery-2.0.1.min.js" /> <link href="script/jquery.contextMenu.css" rel="stylesheet" type=

Getting data from child controls loaded programmatically

半世苍凉 提交于 2020-01-07 06:43:22
问题 I've created 2 controls to manipulate a data object: 1 for viewing and another for editing. On one page I load the "view" UserControl and pass data to it this way: ViewControl control = (ViewControl)LoadControl("ViewControl.ascx"); control.dataToView = dataObject; this.container.Controls.Add(control); That's all fine and inside the control I can grab that data and display it. Now I'm trying to follow a similar approach for editing. I have a different User Control for this (with some textboxes

Input type=“date” not working in certain browsers

独自空忆成欢 提交于 2020-01-07 02:31:48
问题 I've got an ASP.NET web forms page where I'm setting the value of an input (type="date") in code-behind and it displays correctly in IE 11 and Firefox 51, but in Chrome 56 and Opera 43, it merely displays the mm/dd/yyyy placeholder. Below is my code. The ASPX... <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Test Page</title> <link rel="stylesheet" type="text/css" href="../Content/bootstrap.css" /> <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1

Master page won't compile when referencing its own properties and members

拜拜、爱过 提交于 2020-01-07 02:10:05
问题 When upgrading a dotnet Web Site based on asp.net WebForms to a Web App I'm having trouble with Master pages. My Master pages contain, in their .aspx file markup, references like this: <div> Name: <% =GetUserName() %> Account: <% =AccountId %> </div> GetUserName() is a protected method defined in my master page's codebehind file, and AccountId is a protected field in the same place. After doing the Web App upgrade (which involves automatically generating a Site.Master.designer.cs codebehind

Access <asp:table> table rows added by javascript in asp.net webform

孤街浪徒 提交于 2020-01-06 21:06:06
问题 have an app that is trying to capture several entries added to an control by the user. The user enteres data into a single text box and then clicks add. This value is then appended to the table like so: <tr><td>some value</td></tr> I'm trying to avoid round trips so the server but so far am having trouble. The form posts back but the new added rows aren't in the .Rows collection... is this possible to do? 回答1: You cannot get table rows added at client side appear into server side row

MaintainScrollPositionOnPostback is not working - how to debug?

我只是一个虾纸丫 提交于 2020-01-06 08:42:04
问题 I inherited some web shop project ( ASP.NET 3.5, Webforms , Visual Studio 2008 PRO ). On one page I have MaintainScrollPositionOnPostback set to true . When shopping cart (user control loaded in master page) is empty, then asp.net is not generating Javascript code required for scroll position. When I add some items to the cart, then everything works fine. Can you give me any advice how to find part of the code which is responsible for this issue? I don't have an access to the 3rd party

How to access a Div inside a repeater using javascript

谁都会走 提交于 2020-01-06 08:25:07
问题 Simply, I have an anchor inside a repeater that triggers on click a javascript function, which sets the innerHTML of a Div to some content. trying this outside a repeater did work! but if I tried to implement the same code in the repeater's item template, it won't work! NOTE: I think I need to access the repeater first then access the Anchor inside it! but I don't know how to do it For further illustration: JavaScript Function: function show(ele, content) { var srcElement = document

calling asp.net codebehind function from javascript

只愿长相守 提交于 2020-01-06 08:09:49
问题 I have custom control called LinkControl : <asp:Panel runat="server"> <script language="javascript" type="text/javascript"> function CheckImage() { var str = document.getElementById('<%=lblBookmarkId.ClientID%>').firstChild.nodeValue; PageMethods.CodebehindCheckImage(str); return false; } </script> <asp:Label runat="server" ID="lblBookmarkId" Style="visibility: hidden;" /> <asp:Button runat="server" ID="btnCheck" Text="Check" OnClientClick="return CheckImage();" CausesValidation="false""/> <

How to create an ID based PHP form?

纵饮孤独 提交于 2020-01-06 07:12:29
问题 I want to basically create a PHP form that stores data into a database - based on what you enter - this is of course basic. However, there is one quirk: This php form must be id based - given a link. Let's say something like mywebsite.com/form.php=id446 will generate a much different form than something like mywebsite.com/form.php=id447 . The difference in both the forms is about 3-4 form fields(whether they appear or not), rest is the same Now, I could brute force this and just make form446

How to replace IDs of users with their fullNames in the current scenario?

对着背影说爱祢 提交于 2020-01-06 06:46:25
问题 I have two databases with the following schema: tbl_users(userID, fullName, emailID, password) userID is the Primary Key tbl_savings(savingsID, creditorName, amount, interestRate, interestType, interestCalculationMethod, ownerID, dataEnteredByID) savingsID is the Primary Key. ownerID is a Foreign Key on userID of tbl_users with a one-to-many relationship. ownerID specifies the ID of the owner of the saving. Similarly, dataEnteredByID specifies the ID of the person who entered the data. I have