CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/6/2007 1:52:17 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 12 Views: 165 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
13 Items, 1 Pages 1 |< << Go >> >|
atarikg
Asp.Net User
Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/6/2007 1:52:17 PM

0/0

i wanna Get Selected Value for SqlDataSource's Select Parameter located in Content Page from ListBox located in Master Page ? So how can i do that ?

 

Thanks in Advance..


I am not a perfect programmer, but i have perfect programmers' habits [ i think so :)]
e_screw
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 5:33:23 AM

0/0

Write a public property in the MasterPage that returns the ListBox text/value, so that you can call it in your contentpages.

public partial class MasterPage1 : System.Web.UI.MasterPage
{
    public string ListBoxValue {
        get { return ListBox1.SelectedItem.Value; }
    }

    protected void Page_Load ( object sender, EventArgs e) { .... }
}

In you ContentPages, you can access it, by  calling ListBoxValue property

Thanks

-Mark post(s) as "Answer" that helped you


Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
atarikg
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 8:31:48 AM

0/0

wow that was really nice method like it :) thanks and i'll mark your answer as an answer like how you said you footer text :) thanks again by the way...

but i would like you to answer something for me again..if i want to pass this value to sqldatasource select paramater, how can i do that ? i mean for example how can i reach specific select parameters value and put a value in it. for example again :) : you gave me a method to get the value from selected index of ListBox control located in Master Page and i want to use this value for SqlDataSource (located in Content Page) Select parameters referring to a condition in where statements and in according to this statement there are some datas being called from database and binded to detailsview. and which event of sqldatasource i should use and put my code under... ?

Thanks in advance...


I am not a perfect programmer, but i have perfect programmers' habits [ i think so :)]
e_screw
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 8:42:27 AM

0/0

Depending on the event in which you want to bind the datasource, you can set the SqlParameters on the datasource. If you want to bind it in the Page_Load

protected void Page_Load (object sender, EventArgs e)
{
    // set the parameters
    SqlDataSource1.SelectParameters["parameter name"].DefaultValue = ListBoxValue; // ListBoxValue from MasterPage
    // bind to the detailsview
    DetailsView1.DataSource = SqlDataSource1;
    DetailsView1.DataBind();
}

Thanks

-Mark post(s) as "Answer" that helped you


Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
atarikg
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 11:00:40 AM

0/0

and the last one is default value is static or dynamic ?


I am not a perfect programmer, but i have perfect programmers' habits [ i think so :)]
e_screw
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 11:52:34 AM

0/0

Its dynamic, have you had set its value through code.

Thanks


Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
atarikg
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 4:38:16 PM

0/0

Thanks again. You saved me from really terrible issue..

Have a nice day...


I am not a perfect programmer, but i have perfect programmers' habits [ i think so :)]
atarikg
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 5:21:33 PM

0/0

well i encountered some problems on doing it. Sad

  1. It says me i have to declare the parameters when i put it under Page_Load event using your way mentioned above

and long story short :

All i want is that :

This is my SqlDataSource control located in Content Page and i've set it like that (i've put a picture to show my sqldatasource control Select statement stuffs)

and this is my content page screenshot :

and this is the error system gave me:

and what i want is to relate ListBox1.SelectedValue (located in Master Page) to SqlDataSource's KullaniciID parameter. How can i do that .. Please help me and the people who might encounter same problem in the future :)

Thanks in advance and i'll be waiting your answer as much as soon.


I am not a perfect programmer, but i have perfect programmers' habits [ i think so :)]
e_screw
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 8:10:01 PM

0/0

Add a parameter as described in the image.

Thanks


Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
atarikg
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 10:43:32 PM

0/0

Ok. I'll try it again and thanks for giving answers to my all questions :) i am appreciated.

Have a nice day and by the way i'll write again if i encounter another problem :)


I am not a perfect programmer, but i have perfect programmers' habits [ i think so :)]
pkellner
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/7/2007 11:30:50 PM

0/0

E-Screw,

Great answer and graphics! 

e_screw:

Add a parameter as described in the image.

Thanks

 


Peter Kellner
http://73rdstreet.com and blogging at
http://PeterKellner.net
MVP, ASP.NET
e_screw
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/8/2007 5:53:11 AM

0/0

Thank you P Kellner and Atarikg

 


Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
atarikg
Asp.Net User
Re: Get Selected Value for SqlDataSource Select Parameter located in Content Page from ListBox located in Master Page10/8/2007 9:26:31 AM

0/0

Thank you very much. I've just tried your way and now it is working properly :) and the way you offered me in your first reply to show me how to reach listbox value from master page in content page is so perfect :) i hold it..

Have a nice day...


I am not a perfect programmer, but i have perfect programmers' habits [ i think so :)]
13 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Get Selected Value for SqlDataSource Select Parameter located in ... i wanna Get Selected Value for SqlDataSource's Select Parameter located in Content Page from ListBox located in Master Page ? So how can i do that ? ...
Listbox Multiselect as filter for Gridview selected value from ListBox(and multi-select mode), I think you will ... parameter into the SqlDataSource's filtering parameter collection. ...
Walkthrough: Creating a Nested GridView Control Add a procedure to handle the RowDataBound event of the parent GridView control in order to set the select parameter value for the nested SqlDataSource ...
InformIT: ASP.NET 2.0: Is It Really This Easy? > A Day in the Life ... Figure 2.10 Setting the properties of the new SqlDataSource to select the ..... At runtime, the Master Page content merges into the content generated by the ...
TheMSsForum.com >> Asp >> SqlDataSource identity - The Microsoft ... find control question i have a master page and aseries of ...... mode I would like to set the SelectedValue of the ListBox to the newly ...
How to populate several textbox with data from a DataTable : ASP ... May 30, 2008 ... NET page which contains a listbox and gets its information from a SQL ... datasource will be your sqldatasource. add a select parameter ...
.NET ASP Page 34 - Bytes Site Map Session Timeout before in Windows 2003 · publish web website got compilor error CS0433 for master page · Passing and using parameters ...
ASP.NET Web Controls,Themes, and Master Pages populate the ListBox with the current value in the TextBox: ..... IDE, select Web Site ➤ Add Content Page (if a *.master file is not the active item in the ...
Usenet replayers subject overview of "microsoft.public.dotnet ... DownloadFile Question; Calling js file from Master page; Dynamic Page (Page. ... SQLDataSource parameter referencing a text box in a user contr ...
Why wont this multiple selection listbox insert values into db ... 1 <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Create .... 129 - Please Select ...




Search This Site:










portal reverts to admin skin randomly!

databinding property for textbox control

visual web developer 2008 data connection problem

msoft killing vb.net?

classbrowser for 3.0.4

security context for cache item expiration callback

getting "a critical error has occurred." with new custom module

'catastrophic failure' using aspnetwindowstokenroleprovider

recent worm patch killed dnn i'm guessing

run cgi application under integrated windows environment in iis 6.0

sponsers

general network error page

how to creat new page ,database and conection in clubstarterkit?

cls-compliant web controls?

cannot load type dotnetnuke.global

styling solpartmenu

skinning problems

what about rule based security?

problem with isonline property

converting treeview

hiding asp.net codebehind file's code from web hoster.

rsa problem

adding javascript in content page

help with tree view / site map

run a console exe from webpage

launching project in debug mode on vs2008 leaves ie hanging

how avoid to create/delete file within codebehind file

membership login

i need another (in addition to solpart) menu system

login loop

 
All Times Are GMT