Forms Data Controls :: Pass A Variable From Listview Control To A Sub In Visual Basic?

Jan 14, 2010

I'm trying to pass a value (address) from a listview control using visual basic to a google map address control on the page load event. Here is the code I have so far in vb:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Pass address from Listview to Googlemap address
GoogleMap1.Address = ???
GoogleMap1.Zoom = "14"
GoogleMap1.ShowScaleControl = True
GoogleMap1.EnableInfoWindow = True

[Code]....

View 3 Replies


Similar Messages:

Web Forms :: Make Public Variable (Visual Basic 2008)?

Jan 18, 2010

I have declared a variable as public (Visual Basic 2008). As a result I can call its value in all subroutines. However I cannot change its value in any of the subroutines?! How to do that? The variable I'm having trouble with (see code below) is called 'antwoordbestand' and I want to change its value in subroutine startKnop_Click.

[Code]....

View 1 Replies

Forms Data Controls :: Delete A Gridview With Visual Basic?

Dec 3, 2010

Is there a way to delete an entire gridview with code? I have a gridview that is created based on a value is selected in another gridview, and the bound columns keep being created on top of the previously created gridview. I would like to completely delete it and create it anew based on the new selection.

View 4 Replies

Forms Data Controls :: Trying To Show Literal Value Instead Of Foreign Key - Visual Basic

Apr 26, 2010

For my Dynamic Data site I have a table that has a join to a number of other tables. If I use the standard page for this table I get all of my columns from the primary table and related tables (which is good) and the appropriate literal values from the related table (which is great). The bad part is the order of the columns.

To address the order of the columns I created Custom Folder/Page for the table. I also have a partial class that controls date formatting. This takes care of the ordering of columns fine (which is a step forwared), but now I'm seeing the foreign key IDs instead of the literal values from related tables (which is a step backward).

All I did was copy the standard page to the Custom folder for the table, turn off AutoGenerateColumns, and specify the column order and display name. Why would the foreign key change occur? As a side note, if addressing column order in the partial class is the preferred method I could go that route, but I haven't been able to understand how to do that in VB (I've seen many examples in C#, but that's not my strong point).

View 2 Replies

CustomValidator Control In Visual Basic

Mar 12, 2010

VWD 2008 Express. Visual Basic.I have a customvalidator on my page and a corresponding OnServerValidate routine tied to this control in my VB code behind. I also have a "Save" button that is defined as "CausesValidation=True." I placed a breakpoint in my OnServerValidate code for the customvalidator and a breakpoint in my OnClick routine for the Save button. What I expect to happen is that when the "Save" button is pressed, all the validation is checked before ever entering the OnClick code for the Save button. If any of the validators are false, then I expect that the Save button OnClick code will not run.

[Code]....
[Code]....
[Code]....

View 11 Replies

Forms Data Controls :: Pass Variable With Repeater Hyperlink URL

Jan 15, 2010

I query the database to get the VideoName and VideoURL of the videos held in my database (Videos saved on the file system with their location stored in the database) then bind the query results to a repeater with the following code

protected void Page_Load(object sender, EventArgs e)
{
// Variables declaration
string strConnString = ConfigurationManager.ConnectionStrings["vidConnectionString"].ConnectionString;
SqlConnection sqlConn = new SqlConnection(strConnString);
SqlCommand sqlcmd = new SqlCommand("SELECT [VideoName], [VideoURL] FROM [Video]");
SqlDataReader sqlReader;
sqlConn.Open();
sqlcmd.Connection = sqlConn;
sqlReader = sqlcmd.ExecuteReader();
VideoRepeater.DataSource = sqlReader;
VideoRepeater.DataBind();
sqlConn.Close();
}

and put a hyperlink into the repeater to list all the VideoName's this works fine but I want to pass the VideoURL to the next page I am using NavigateUrl="PlayVideo.aspx?VideoURL='<%# Eval("VideoURL") %>'" but when I try and load the Page I get the error saying The server tag is not well formed. the whole repeater code is

<asp:Repeater ID="VideoRepeater" runat="server" >
<ItemTemplate>
<asp:HyperLink ID="VideoLink" NavigateUrl="PlayVideo.aspx?VideoURL='<%# Eval("VideoURL") %>'" runat="server"><%# Eval("VideoName") %></asp:HyperLink>
</br>
</ItemTemplate>
</asp:Repeater>

I'm sure i've just got the hyperlink navigateURL wrong put not sure how else to pass the VideoURL variable

View 9 Replies

Forms Data Controls :: How To Push Down Outer ListView From Nested ListView Control

Mar 13, 2011

I have anested ListView control. I also implemented a jQuery to automatically expand the TextBox control inside of the nested ListView Insert Template. The problem is, when the Textbox expand, the outer ListView control is not; therefore, the Textbox control expands underneath the buttons of the outer listView control. How do I expand the outer ListView control as the nested ListView textbox is automatically expand? One great example is in Facebook where if I add a response comment, it'll automatically push any comments below mine down. If nested Listview control is not the best way to do this, what are my options?

View 8 Replies

Forms Data Controls :: Pass Variable(s) To GridView HyperLinkField's NavigateUrl?

Aug 3, 2010

For example:

<asp:HyperLinkField Text="Edit" NavigateUrl="EditPage.aspx?var1=Variable1&var2=Variable2" />

I realize this can't be done through the page's mark up, at least I think this is so, but if someone could explain the easiest way the concept could work I'd be very appreciative. Basically, I just need a user to be redirected to a page with more than one variable in the url. If you are unclear with what I'm asking don't hesitate to ask me to explain a little better.

View 2 Replies

Forms Data Controls :: ListView And Hyperlink Pass Parameters

Oct 18, 2010

I am trying to add a hyperlink to the below listview. This hyperlink passes multiple parameters to the next page? I am trying to achieve the below, works with a gridview but not below.

View 4 Replies

Web Forms :: Pass Variable As Html Control Through To Javascript Function

Jan 24, 2011

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.

View 4 Replies

Web Forms :: Assigning Value To Variable On A Page Dynamically And Pass To Control

Apr 11, 2010

Generally I want to pass string result of some control to other control or htm tag like without using specific classes in my ASPX page, only my control and what asp gives:

<a href="<MyControls:MyContr Param="Tech"/>">my link</a>

but this doesnt work - href is not executed, server treats it literally <MyControls:MyContr Param="Tech"/> so I would like to know it is possible to do it like in JSP pages:

- pass <MyControls:MyContr Param="Tech"/> to some variable $myVariable
- pass $myVariable to href like <a href="$myVariable" ?

View 2 Replies

Forms Data Controls :: Listview Itemtemplate/alternatingitemtemplate Modalpopup Pass Parameters To Iframe?

Mar 8, 2011

I am trying to enable server side code to check my session varible but my itemcommand is not being executed because my modalpopup is client click.Each template is loading the iframe which is horible performance killer. How do I get it to load the iframe on LinkButton click only once?

[Code]....

[Code]....

View 4 Replies

Forms Data Controls :: How To Pass Session Variable As A Parameter To Inline Function Written Inside A Repeater

Jun 26, 2010

I am working with a repeater control for a reporting purpose.

I have 2 repeaters one inside another , i hvae to bind the second repeater with the help of function which is having two parameters to pass in it

<asp:Repeater
ID="Rptgsaaccount"
runat ="server"
DataSource ='<%#bindcourse(Eval("Session_Id"),2nd parameter)%>'>

the first parameter is i am easily getting from outer repeater, but the second parameter value is exist on the server side and in a session variable

i have to pass this server side session variable value in above mentioned function as a second parameter .

View 2 Replies

Forms Data Controls :: Pass Value From Child (popup Window) To Textbox Within Listview In Parent Page

May 25, 2010

I have a listview that has n rows.

Within the EditItemTemplate and InsertItemTemplate I have a cell that has a textbox and a button.

When the button is clicked a popup window is shown, where the user can upload a picture. The name of the uploaded picture is retrieved.

Now I want to send that picture name back to the textbox within the listviews EditItemTemplate or/and InsertItemTemplate (that is ofcourse one at a time depending on what the user is doing, inserting or editing a row).

The code I have written so far looks like this. The below code has been abbreviated

[Code]....

The code behind looks like this (also abbreviated). Actually I don't think the code behind is needed, since its mainly javascript from the popup window (child page), but nevertheless here it goes.

[Code]....

And at last the child page / popup page.

Well there is not anything to see here, cause I'm using the Telerik RAD upload control, which is doing everything for me.

However the line below may be of interest. Here I'm taking the name of the uploaded file (picture) and printing it to a label.

[URL]

View 2 Replies

Forms Data Controls :: Nested GridView Control Returns "Object Variable Or With Block Variable Not Set" ?

Oct 20, 2010

Nested GridView Control returns "Object variable or With block variable not set" when outer GridView returns rows.

The Nested GridView Control works as long as the outer GridView returns rows, the following code works: [Code]....

Object variable or With block variable not set.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object variable or With block variable not set.

Source Error:

Line 118: If e.Row.RowType = DataControlRowType.DataRow Then
Line 119: Dim myStatus_ID As SqlDataSource = CType(e.Row.FindControl("sqlDeviceStatusAssign"), SqlDataSource)
Line 120: If Not e.Row.DataItem("Status_ID") Is Nothing Then
Line 121: myStatus_ID.SelectParameters(0).DefaultValue = e.Row.DataItem("Status_ID")
Line 122: End If

I have tried checking for IsDbNull and checking to see if a label exists in a given row. This code *If Not e.Row.DataItem("Status_ID") Is Nothing Then* appears to do nothing.Same with the following:

*Dim localLblItemReference As Label = CType(e.Row.FindControl("lblItemReference"), Label)

*If Not localLblItemReference Is Nothing Then

******************************************************************************************

To further clarify my question above, I am looking for a method to detect e.Row.DataItem("Status_ID") is nothing/null due to the outer GridView returning 0 results in a query.I have a (Outer) GridView Control with another GridView Control inside of a template field with it's associated SqlDataSource control.

In the "Protected Sub GridViewReport_RowCreated", I provide the Select Parameter for the associated SqlDataSource with the DataItem row value.When the (Outer) GridView Control does not return any rows, the "e.Row.DataItem("Status_ID")" throws a:

Exception Details: System.NullReferenceException: Object variable or With block variable not set.

View 3 Replies

DataSource Controls :: Retrieve Data From SqlDataSource And Pass To A Variable?

Aug 20, 2010

I have a page in my website where there is very little code-behind. I only have two lines of code in Page_Load() and the rest of the code is declarative ASP.NET code. I have a FormView control which uses a SqlDataSource to get some order information. The SqlDataSource calls a stored procedure called usp_GetOrderDetails, here's the code for the SqlDataSource:

[Code]....

<truncated>

What I want is to grab the screenshotId from the SqlDataSource when the usp_GetOrderDetails stored proc gets called and populate it into a field on the page called screenshotId. I then want to use this screenshotId to get an image from the database based on Id. populating the screenshotId field. How do I do this - do I need to have something like OnDataBound or something like that?

View 4 Replies

C# - Can't Pass A Variable To A User Control?

Jun 17, 2010

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:

<Test1:Test runat="server" ID="testControl" Target="<%# Request.RawUrl %>"></Test1:Test>

I find that the Target property is never called.If I use this line instead:

<Test1:Test runat="server" ID="testControl" Target="<%# Request.RawUrl %> test"></Test1:Test>

the string value "<%# Request.RawUrl %> test" is passed to the Target property.f I use this line as explained in many posts online:

<Test1:Test runat="server" ID="testControl" Target="<%= Request.RawUrl %>"></Test1:Test>

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:

namespace Testing
{
public class Test : Control

[code]...

View 1 Replies

Data Controls :: How To Modify Static Variable At Runtime To Pass Data From One Form To Another

Apr 16, 2014

I have using Static Variable  in My project.i want Change Static variable value because of transfer the value b/w two  Forums... and I want Change value at run time...provide solution

Or else Any other way transfer value b/w two forms......

View 1 Replies

Data Controls :: Send (Pass) GridView Row Values To Next Page Using Session Variable

Nov 6, 2013

i have a gridview with link button and one field called "ID" i have five values....when i click the link button that row value ill show in next page in textboxes ,txtid, txtage, txtsalary,......... if i click that link button that "Id" values should pass to next page using "SESSION" variable in C#.net

View 1 Replies

How To Pass Value From A Control Inside A Listview To Another Control Outside

Jan 28, 2011

I have a Listview displaying one record at the time. Here is a very simple example:

<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="bol_id" ItemPlaceholderID="itemPlaceholder">
<ItemTemplate>

[code]...

View 2 Replies

Data Controls :: Pass ListView Selected Item (Row) Details To Another Page Using HyperLink?

May 7, 2015

 I have used a label in listview whose text is bound to database.I want to show that label text in other page.How I can do it?

View 1 Replies

Java -comparison Between Microsoft Visual Studio 2005, Visual Basic And Netbeans

Jul 3, 2010

I need to write a paper on the comparison between (Microsoft Visual studio 2005 to develop web applications using asp.net) and (visual basic and Netbeans to develop j2ee applications using java).I need suggestions for good webpages,journals or documents which can help me out here. I have to write at least 1500 words

View 1 Replies

Visual Studio :: Solution Explorer Only Creates Visual Basic LinqToSql Classes?

Feb 14, 2010

Even though I when I create a linqtosql class I mark C# as the language it was always shows up as a Visual Basic file in the App Code file. I can't get it to stop doing that. ????? What is going on?

View 5 Replies

DataSource Controls :: Violation Of UNIQUE KEY Constraint Visual Basic Error Page

Apr 27, 2010

I'm new to asp.net and I'm building a project in which I send data to a database MSSQL, I've set a constraintname on some fields that I wantto be unique, now how do I catch that error when people insert a duble and handle it with a redirectionto custom error pagehere the code just in case you need it

Dim con As New System.Data.SqlClient.SqlConnection
con.ConnectionString = "Data Source=localhost;Initial Catalog=Database1;User ID=user;Password=password;TrustServerCertificate=True"
Dim myCommand As New System.Data.SqlClient.SqlCommand
myCommand.CommandText = "INSERT INTO serves(CategoryID,UserId,vote, Img, link, Description) VALUES('" & DropDownList1.SelectedValue & "','" & UId.Text & " ' ,1,'" & TextBox1.Text & "','" & "<a href=" + TextBox2.Text + ">" + TextBox4.Text + "</a>" &
"','" & TextBox3.Text & "')"
myCommand.Connection = con
con.Open()
myCommand.ExecuteNonQuery()

View 5 Replies

Forms Data Controls :: Cannot Find Control In Listview

Jan 31, 2011

I've an anchor tag in listview itemtemplate, I'm trying to find that control in Listview Item databound event with the below snippet

[Code]....

but lnkEdit is always null.

I wonder why it is not able to find the control while I can see it in page view source.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved