I have done the following in codebehind of a master page trying to use codebehind to dynamically declare a variable (TextBox1) that exists on my content page. I can't declare it in the html because it is on the content page and unless I am viewing that particular content page, I get an error. So I am trying to create it here when needed.
I don't get an error, but my value for TxtBox1 in the end is "null". I have selected onPreRender to make sure that it is the last thing to take place.
We have an web application which has been working fine on XP but which fails on Windows 7.I have a page where I'm executing several procedures on server-side and then must execute a vbscript function on client-side which I'm registering from my server code.The problem is after postback completed vbScript function is not executed at all.... even a simple "Alert" statement is not executed but only using Windows 7.... same code works fine on windows XP...
I'm using ClientScript.GetPostBackClientHyperlink in the OnRowCreated event of the GridView to postback when you select a row. I put a column of checkboxes in now and when 1 or many checkboxes in the row are selected I don't want the page to postback. I'm having trouble with this.This is my code:
i am facing a strange problem putting it in short .... i have two grids... i have grid1 and grid2... now based on row click of firstgrid..i wd take d id from cell(0) of first grid and then fill up the 2nd grid based on tht info selected (id) from the 1st grid .... here is the code snippet :
and here is the codebehind :
now the problem is that : when i click the row for first time it shows into the 2nd grid all fine ...
I have aspx page where there is no code behind. Server side Code written inside tag with runat server attribute.
I know how to register a client script that is on my web page, but I would like to know how to register my script when the script is in another file. Does anyone know how to register a file containing java script file. This is my code for calling the function when it's in the page.
I use AlwaysVisibleControl in a page and show a result of data access in popup with ClientScript(or
The problem i have noticed is that sometimes after a clientscript alert() the page will not post back properly and kind of "hang". The page will only show the background and will not do anything until the browser is refreshed.
I call clientscripts withing button click events, after the code has succeded or failed(try catch). So i will write to database/upload file/send email and then depending on the restult run a clientscript alert to notify the user. However sometimes after you "Ok" the alert the page does not finish posting back and "hangs" half loaded.
how to fix it? would adding return false; after the alert in the client script at all? (i have seen this in a online code example but they did not explain why they put it there).
I get the above error while compiling and the name is in my .aspx file while i try to assign it in my .vb file like this IN .aspx file:
<tr> <td class="txtarialsml">SEC Fee</td> <td> <asp:TextBox runat="server" ID="txtsec" Width="150px" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" ReadOnly="true" CssClass="txtverdlink" Height="18px"></asp:TextBox></td> </tr> <tr> <td class="txtarialsml">CSCS Fee</td> <td> <asp:TextBox runat="server" ID="txtcscs" Width="150px" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" ReadOnly="true" CssClass="txtverdlink" Height="18px"></asp:TextBox></td> </tr> <tr> <td class="txtarialsml">NSE Fee</td> <td> <asp:TextBox runat="server" ID="txtnse" Width="150px" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" ReadOnly="true" CssClass="txtverdlink" Height="18px"></asp:TextBox></td> </tr> In .VB file Protected Sub drpstock_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles drpstock.SelectedIndexChanged Try txtsec.Text = "" txtnse.Text() = "" txtcscs.Text() = "" Catch ex As Exception Session("errorcode") = "blabla" Session("errordesc") = "This exception occurred while trying to fetch data." Response.Redirect("../errorpage.aspx") End Try End Sub Public Sub dg_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Dim row As DataGridItem = e.Item lblData.Text = "in subprocedure" If row.ItemType = ListItemType.Item OrElse row.ItemType = ListItemType.AlternatingItem Then Dim day As DateTime = Convert.ToDateTime(DirectCast(row.DataItem, DataRowView)("day").ToString()) Dim tempMonth As Integer = day.Month Dim lblMonth As Label = DirectCast(row.Cells(0).FindControl("lblMonth"), Label) If row.ItemIndex = 0 Then UpdateLabel(lblMonth, day) End If If currMonth <> tempMonth Then 'add blank row currMonth = tempMonth j += 1 AddRow(row.ItemIndex + j) UpdateLabel(lblMonth, day) End If End If End Sub
Compiler Error Message: BC30451: Name 'ModalPopupExtender1' is not declared.
For example, the following is contained in Main.Master:
var modal = $find('<%=ModalPopupExtender1.ClientID%>'); document.getElementById("<%=Image1.ClientID%>").src = imageList[imageIndex];
However, ModalPopupExtender1 and Image1 are contained in Search.aspx.