Showing posts with label view. Show all posts
Showing posts with label view. Show all posts

Thursday, March 29, 2012

pass my dropdownlist

hey all,
i'm in vs2005 designer view editing a formview's edit template. i have a
dropdownlist and i'm trying to bind the SelectedValue to a custom expression
.
i was wondering if it is possible to pass the dropdownlist object down to th
e
code-behind? i tried using the this keyword but that didn't work.
thanks,
rodcharCan you please eloborate a little more?
Are you trying to access the Dropdownlist in the designer or in some
routine in the code behind?
If it is in the code behind of the samepage where the dropdown is declared,
I do not see any problem accessing it.
Can you give an example of your code?
--
>Thread-Topic: pass my dropdownlist
>thread-index: Acg2ih2bZVRS0qv3TbWr/MzGXJ0Yjg==
>X-WBNR-Posting-Host: 24.214.205.110
>From: examnotes <rodchar@.discussions.microsoft.com>
>Subject: pass my dropdownlist
>Date: Tue, 4 Dec 2007 07:27:01 -0800
>Lines: 8
>Message-ID: <31752D5F-72C8-4B2C-ACA5-E868CEF35F42@.microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.framework.aspnet:52357
>NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>hey all,
>i'm in vs2005 designer view editing a formview's edit template. i have a
>dropdownlist and i'm trying to bind the SelectedValue to a custom
expression.
>i was wondering if it is possible to pass the dropdownlist object down to
the
>code-behind? i tried using the this keyword but that didn't work.
>thanks,
>rodchar
>
Thank You,
Nanda Lella,
This Posting is provided "AS IS" with no warranties, and confers no rights.
you're right, i just realized how obvious my question was after i posted. i
apologize.
"Nanda Lella[MSFT]" wrote:

> Can you please eloborate a little more?
> Are you trying to access the Dropdownlist in the designer or in some
> routine in the code behind?
> If it is in the code behind of the samepage where the dropdown is declared
,
> I do not see any problem accessing it.
> Can you give an example of your code?
> --
> expression.
> the
> --
> Thank You,
> Nanda Lella,
> This Posting is provided "AS IS" with no warranties, and confers no rights
.
>

pass my dropdownlist

hey all,
i'm in vs2005 designer view editing a formview's edit template. i have a
dropdownlist and i'm trying to bind the SelectedValue to a custom expression.
i was wondering if it is possible to pass the dropdownlist object down to the
code-behind? i tried using the this keyword but that didn't work.

thanks,
rodcharCan you please eloborate a little more?
Are you trying to access the Dropdownlist in the designer or in some
routine in the code behind?
If it is in the code behind of the samepage where the dropdown is declared,
I do not see any problem accessing it.

Can you give an example of your code?

-------

Quote:

Originally Posted by

>Thread-Topic: pass my dropdownlist
>thread-index: Acg2ih2bZVRS0qv3TbWr/MzGXJ0Yjg==
>X-WBNR-Posting-Host: 24.214.205.110
>From: =?Utf-8?B?cm9kY2hhcg==?= <rodchar@.discussions.microsoft.com>
>Subject: pass my dropdownlist
>Date: Tue, 4 Dec 2007 07:27:01 -0800
>Lines: 8
>Message-ID: <31752D5F-72C8-4B2C-ACA5-E868CEF35F42@.microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
>charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Path: TK2MSFTNGHUB02.phx.gbl
>Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.framework.aspnet:52357
>NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>hey all,
>i'm in vs2005 designer view editing a formview's edit template. i have a
>dropdownlist and i'm trying to bind the SelectedValue to a custom


expression.

Quote:

Originally Posted by

>i was wondering if it is possible to pass the dropdownlist object down to


the

Quote:

Originally Posted by

>code-behind? i tried using the this keyword but that didn't work.
>
>thanks,
>rodchar
>


--

Thank You,
Nanda Lella,

This Posting is provided "AS IS" with no warranties, and confers no rights.
you're right, i just realized how obvious my question was after i posted. i
apologize.

"Nanda Lella[MSFT]" wrote:

Quote:

Originally Posted by

Can you please eloborate a little more?
Are you trying to access the Dropdownlist in the designer or in some
routine in the code behind?
If it is in the code behind of the samepage where the dropdown is declared,
I do not see any problem accessing it.
>
Can you give an example of your code?
>
-------

Quote:

Originally Posted by

Thread-Topic: pass my dropdownlist
thread-index: Acg2ih2bZVRS0qv3TbWr/MzGXJ0Yjg==
X-WBNR-Posting-Host: 24.214.205.110
From: =?Utf-8?B?cm9kY2hhcg==?= <rodchar@.discussions.microsoft.com>
Subject: pass my dropdownlist
Date: Tue, 4 Dec 2007 07:27:01 -0800
Lines: 8
Message-ID: <31752D5F-72C8-4B2C-ACA5-E868CEF35F42@.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: TK2MSFTNGHUB02.phx.gbl
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.framework.aspnet:52357
NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

hey all,
i'm in vs2005 designer view editing a formview's edit template. i have a
dropdownlist and i'm trying to bind the SelectedValue to a custom


expression.

Quote:

Originally Posted by

i was wondering if it is possible to pass the dropdownlist object down to


the

Quote:

Originally Posted by

code-behind? i tried using the this keyword but that didn't work.

thanks,
rodchar


>
--
>
Thank You,
Nanda Lella,
>
This Posting is provided "AS IS" with no warranties, and confers no rights.
>
>

Friday, March 16, 2012

Passing a variable

Hello

Just a quick question. I have a hyperlink when clicked transfers a variable to another page and populates a grid view but how would i get this variable to be displayed as the page title

cheers

bigyawn_hippo:

Just a quick question. I have a hyperlink when clicked transfers a variable to another page and populates a grid view but how would i get this variable to be displayed as the page title

Is the variable be transfered by query string?

If so you can do this in the page_load event

//assume query string is called titleif (Request.QueryString["title"] !=null){//set to form caption this.Page.Title = Request.QueryString["title"].ToString();}

Hi

its a query string i am trying to display, but i am using VB code will it be different from the code u ve given

cheers


try this:


if !(Request.QueryString("title")) isnull then
this.Page.Title = Request.QueryString("title").ToString();


Here is the VB equivalent:

Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.LoadIf Not String.IsNullOrEmpty(Request.QueryString("title"))Then Page.Title = Request.QueryString("title")End If End Sub

Here is the VB equivalent

Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.LoadIf Not String.IsNullOrEmpty(Request.QueryString("title"))Then Page.Title = Request.QueryString("title")End If End Sub

Hi

I placed the code in the vb file but the title of the page remains Untitled

I change "title" to the name of the field that i want it to display should it be somthing else

cheers


if you type yourpage.aspx?title=SomeTitle in your browser, the code I posted should work. Is there something I'm missing here? Are you doing it differently somehow?


Have you set a header control on the aspx page: <head runat"server"> instead of just <head> ?


These may be reasons for which it doesn't wotk

1. You didn't put that method posted few lines up in Page_Load

2. Your querystring do not exist or have another name


hi

I ve set my head to runat server but the code is still not working, i m new to asp so please have paitence but i ve inserted that code u suggested but it causes more errors could you give me the code from ur aspx file.

cheers


Sure:

<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> </div> </form></body></html>

And code behind:

PartialClass _DefaultInherits System.Web.UI.PageProtected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.LoadIf Not String.IsNullOrEmpty(Request.QueryString("title"))Then Page.Title = Request.QueryString("title")End If End SubEnd Class

if still the top solution did not worked ( i dont know how come it did not ) for u then try this

in first page on button click

Response.Redirect("test.aspx?qtitle =bigyawn");

in the second page codebehind in page load

// in C#

querytitle =Convert.ToString(Request.QueryString["qtitle "]);

in vb

If Not String.IsNullOrEmpty(Request.QueryString("qtitle"))Then
querytitle = Request.QueryString("qtitle") wherequerytitle will be a public string

in aspx page just write like this :

<HTML>
<HEAD>
<title><%=querytitle %></title>