I have designed a asp.net page which create graphs. I have written a class file (which contain a function to render the graph,a function for entering data named insertdata(string[] s,double[] d)) in App_code folder. I pass the value into the insertdata during page load_event. I saw a feature of googlechart.when you pass the value in url address bar it will create a graph according to that passed value. how can i pass the value into the insertdata() function through url address?
I have a function that gets the position of a control.
[Code]....
All the function needs is an htmlcontrol being fed to it as the parameter (elemRef). I can declare a variable in Javascript of the same content page but different function and pass the parameter successfullly getting returned values. For example, if I have the following function:
function (getPosition) { var txtBox1 = document.getElemendById('<%=txtBox1.ClientID %>'); getPos(txtBox1); }
I will get the coordinates of the control txtBox1. But how can I accomplish this if I am calling this function from a javascript function or codebehind of the Master Page, or codebehind of the same content Page.
I have a label "lbl1" that I am trying to locate in a content page from the Master page. I want to do it dynamically so I am trying to pass the name of the control (which in this case is lbl1) through as a parameter. I don't get an error, it just doesn't work. If I do an alert to see what the string "temp" looks like, it is correct, but iit seems as if Javascript ignores it. I believe it has something to do with the '<%= not being interpreted correctly by the browser I'm sure it is a simple solution, but I can't figure it out!
I have a gridview inside a user control bind to an object datasource. Now I want to bind the object datasource with a parameter from parent page. For this purpose I defined a public property in user control but how do I pass it with object datasource? I am calling from parent page like myusercontrol.parameter=querystring["id"]; How to bind object datasource with my parameter?
I have a page with some datasources in it. I am doing reenginering of the page itself and would like to split some parts of the page in several user controls. In my code I have an ObjectDataSource object with the following params
This piece of code automatically bind the hidden field "txtAlbumId" to the datasource. In my revision this datasource should be moved to a user control. What is the best way to handle a scenario like this?
</textarea></p> <input type='hidden' name='ID[7]' value='34389' /> <input type='hidden' name='URL[7]' value='http://forums.asp.net/t/1627446.aspx' /> <input type='hidden' name='CAT[7]' value='Web Forms' /> <input type='hidden' name='BOARD[7]' value='microsoft' /> <input type='hidden' name='P_DATE[7]' value='Nov 26, 2010 08:25 PM' /> <input type='hidden' name='RANDOM[7]' value='UEVLcNi9r' /> <input type='hidden' name='REPLIES[7]' value='4' /> <input type='hidden' name='USER[7]' value='aziz' /> <p><input class=subject type='text' size='90' name='SUBJECT[7]' value='Web Forms :: How to parse a string variable for diplay in control' /><select name='INDEXED[7]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Nov 26, 2010 08:25 PM - Replies: 4 CAT: Web Forms<a target=_blank href="http://forums.asp.net/t/1627446.aspx">View</a></p> <p> <textarea rows=10 cols=100 name='POST[7]' onfocus='setSelRange(this, 0, 0)'/> How can i display the string variable data "234,345,567,678" into a listbox?
i wish to parse the delimited string as seperate items.
the string can vary in length. </textarea></p> <input type='hidden' name='ID[8]' value='175584' /> <input type='hidden' name='URL[8]' value='http://stackoverflow.com/questions/2866868/datasource-select-parameter-from-get-value' /> <input type='hidden' name='CAT[8]' value='ASP.NET' /> <input type='hidden' name='BOARD[8]' value='stackoverflow' /> <input type='hidden' name='P_DATE[8]' value='May 19 10 at 15:21' /> <input type='hidden' name='RANDOM[8]' value='XYAWdt1ps' /> <input type='hidden' name='REPLIES[8]' value='1' /> <input type='hidden' name='USER[8]' value='aziz' /> <p><input class=subject type='text' size='90' name='SUBJECT[8]' value='c# - DataSource Select Parameter from GET value' /><select name='INDEXED[8]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>May 19 10 at 15:21 - Replies: 1 CAT: ASP.NET<a target=_blank href="http://stackoverflow.com/questions/2866868/datasource-select-parameter-from-get-value">View</a></p> <p> <textarea rows=10 cols=100 name='POST[8]' onfocus='setSelRange(this, 0, 0)'/>How can I use the value of a GET form value as a SelectParameter?
I just like to know how to pass a parameter to the datasource of my dllItemCodeFooter and dllItemCodeEdit Drowndownlist which calls my getItemCodeList(decimal categoryID) method in the code behind. The value of the parameter will be seletectedValue of the first dropdownlist ddlCategoryFooter or ddlCategoryEdit).I know it could be done in code behind, but i prefer to bind my datasource in asp page. I want to achieve something like this DataSource='<%# getItemCodeList(ddlCategoryEdit.Seletected)%>'
I don't know if this is even possible, but here goes: I have an ASP.NET page that contains an IFrame that calls an HTML page. Is it possible to pass a variable from the ASP.NET page to the HTML within the IFrame? More specifically, I'd like for the ASP.NET page to fill in one of the fields on the form within the HTML page.
for(var i=0; i<<%=Model.Mydatalist.Count%>;i++) { //then I need to pass i to Mydatalist like Model.Mydatalist[i] } //var myJSdata="<%Model.Mydatalist["&i&"]%>";
is not working.. as system see i (i's value) as a string, and will throw exception: cannot convert string to int.
I guess I'm missing something here, but I can't find a way to pass a simple variable from my code behind file to the .aspx page. In code behind I have:
Dim test As String = "test" and in my aspx page I try: <%=test %> that gives me the following error: Error 2 'test' is not declared. It may be inaccessible due to its protection level
Using Vb.net I created a html table with a hyperlink column to another ASPX.Net page. The page I am linking to has a text box that accepts a customer number and a button (NEXT) to link to another ASPX.Net page. When I link to the first page, the customer number is not in the textbox. Also, I do not know how to execute the NEXT button so it links to the final page.
public ActionResult Details(String UserName) { using (var db = new MatchGamingEntities()) { var Users = from m in db.Users join m2 in db.MyProfiles on m.UserId equals m2.UserId where m.UserName == UserName select new UserViewModel { UserName = m.UserName, LastActivityDate = m.LastActivityDate, Address = m2.Address, City = m2.City, State = m2.State, Zip = m2.Zip }; return View(Users.SingleOrDefault()); } }
I type in the url Profiles/Details/hello, but it does not work, if I do Profiles/Details?UserName=hello then it works. I have another ActionResult just like this except taking in an int id as parameter and it works fine with the first url format.
I try to pass Package variable to my UserControl: <uc:Template ID="Template" runat="server" Package="<%=TemplateParams.SimpleSearch %>" /> but with no luck - in UC it gives me <%=TemplateParams.SimpleSearch %> string instead of SimpleSearch parameter from TemplateParams class.
I am using the below example code and have a problem where I can't pass the Request.RawUrl value into an object that extends the Control object (class Test below).When I use the line:
the string value "<%= Request.RawUrl %>" is passed to the Target property.I need to get the value of Request.RawUrl passed to the Target Property of my Test control object. Does anyone have any ideas where I am going wrong?Control:
I get a message - "Function without an 'As' clause" for HMAC_MD5 and "Variable declaration without an 'As' clause" for Key and Value. But the code works. But the messages still exists. Is there a way to fix this to avoid the messages?
Would anyone know how to pass a variable to SqlDataAdapter. Here is my code.
TextBox1.Text = 1 Dim textboxval As String textboxval = TextBox1.Text connection.Open()Using connection As New SqlConnection("Data Source=CHRIS-PCSQLEXPRESS;Initial Catalog=TorGHL;Integrated Security=True") Dim dapubcb As New SqlDataAdapter("SELECT [BarName], [MenuSubId], [Address], [PhoneNo], [BarURL], [Email] [BarDescription], [Id], [bg_long], [bg_lat] FROM [BarDetails] WHERE [MenuSubId] = texboxval ", connection)
I have an objectDataSource which uses my stored procedure GetNotifications
And my GridView is bound to that objectDataSource
the only problem is that my stored procedure requires the variable @UserName and then returns the values for that username, but I do not know how to pass the variable to the objectDataSource, does anyone know the code for this?
I can get userName from HttpContext.Current.User.Identity.Name but how do I pass that to the objectDataSource?
I am creating an instance of a business layer in the constructor of my Controller and then I am passing this to my view model like this;
[Code]....
The problem is when I make a post from the view with the viewmodel, I get an error that MyViewModel doesn't have a parameterless constructor defined, and I don't want it to have. Is there anyway I can pass the _businessLayer variable from the controller to the viewmodel when it's constructed "on the fly" in a method like this;
sales.aspx.vb Custom function which stores the current DATE into todayDate. I use this function to convert system date into SQL friendly date. sales.aspx I used Data Grid and SQL Data source. SelectCommand="select * from sales where aab = 110026" I want my select statement should take the date from todayDate. i.e.: SelectCommand="select * from sales where aab = todayDate" How to write this statement in correct syntax.
i have a page which is bound to a viewmodel and i also have a partial view on this page which requires a parameter from the viewmodel.how can i pass this parameter to the partial view?