I have an <%#Eval("FirstName")%> in the aspx page, I want to replace "FirstName" to <%#Eval(employee.FirstName)%> but "employee" object
is instantiated in the codebehind like this:
Public employee As New Employee
How can I call this object in the aspx page? Should I can create an "employee" in the aspx? if so, how to do that.
i want to know, if is better to make an entire page in the aspx file or in the aspx.vb file. If you have to decide, which one do you choose? ie in aspx:
Code: <asp:Table ID="Table1" runat="server" Width="980"> <asp:TableRow> <asp:TableCell> SOME TEXT </asp:TableCell> </asp:TableRow> </asp:Table> ie in aspx.vb: Code: dim tabla as new table tabla.id = "Table1" tabla.width = 980 dim fila as new tablerow dim celda as new tablecell celda.text = "SOME TEXT" fila.cells.add(celda) tabla.rows.add(fila) form1.controls.add(tabla)
there I have a situation where I need to make to call to a normal .aspx page from asp.net mvc web application. How can I make this request and get data back from the page. the data will be returned on on the page_load event of the .aspx page
How do you call a codebehind/class method from a gridview in an aspx page? Also, I need to pass the value of databound column to that method. Is this possible?
I am generating a dropdown list in codebehind and cannot get the selectedindexchanged event to fire automatically. It works fine when put directly into the ASPX page, but I need it to be in the codebehind.
I have been trying to call a vb.net function in aspx page how can i do that?. I have done it in C# by
<td><#%GetItemIndex(Container.ItemIndex)%></td> its working fine in C# but in vb.net it says GetItemIndex not declared.
and trying to convert (rptpages is a repeater)
rptpages.Itemcommand += New RepeaterCommandEventHandler( rptpages_ItemCommand1) from C# to VB.net but i dont see itemcommand property in VB.net for the repeater.
Confirm is the JavaScript function in .aspx page. I want to catch the "true" or "False" value returned based on the Click performed on the Confirm window to my code behind(aspx.cs) page.
All I need to know is HOW do I reverence the label from the default page and visa versa..
In the web world things are not the same.. This is just an example .. to prove the point.. but I am trying to copy the settings from one object on page 1 to an object on page2.
I am new to silverlight and I am wondering if it is possible to access silverlight object data from the aspx page that host it. Or have silverlight write to a hidden field on the page on client side.
What I am trying to do is to use silverlight to upload file via WCF (client to WCF Service directly instead of posting data back to the web server then forwarded to WCF service). When uploading a large file, user can still do some data entry etc. And once the upload is done have it write some data return by the WCF service to the aspx's hidden field and postback to the server on submit.
"Object reference not set to an instance of an object." How to solve this kind of errors. In my application,am using C#.Net as codebehind,ASP.Net as front,VS2008(frmwrk3.5). Usually what i'd do to solve this error is thatr i will clr my cache & Tempdatas in my browser.After that my prg will run good.But its not a professinal way right?. error comes after this line
The HTML label control is on master page. And I want to access its value on other aspx.cs page. As there are many other control on the master page so i use the recursive function to access the value but NullReferenceException occurs... The code on aspx.cs page is as:
I have a login.ascx control with three controls (LoginName, Password and A Button) , I want to rase a click event on this button from .aspx page because some restriction is there so that I am unable to write any code on .ascx page.
I have assigned value on login name and password from .aspx onload events. but I an facing problem while rasing event on button.
I am showing code that I have written on .aspx page that I have putten onload section.
Ive created an object and placed it in the session, then in my .ashx handler I want to get that object from the session. The problem is that its always null !
heres how ive placed the object into the session from an aspx page
in my ASPX page, but my class1.vb can't work like this, I have to declare it first in the aspx page, how can I make my Class1.vb file be shared among the whole website?
I have a page, Default.aspx, with its own code-behind file like this:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : System.Web.UI.Page { public int[] anArray; }
What I'd like to do is access to "anArray" from a C# class (not tied to a page) declared in App_Code folder. What can I do?
Edit: As said in the first comment, I really apreciate your about refactoring my connection objects. However, what I'm really doing here is to rewrite an old PHP application in order to get comfortable with basic C# and ASP.NET, so this code will never go really live. So, I'm still intersted in a way (if any) to access an object declared in a code-behind code from a standard C# class.
Edit2: I removed the OdbcConnection object in order to focus to the real problem: how to refer to an object istantiated in a code-behind file from a C# class situated in App_Code?