Welcome to Dream.In.Code
Getting Help is Easy!

Join 135,944 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,737 people online right now. Registration is fast and FREE... Join Now!




adding variable data to a confirmbutton extender

 
Reply to this topicStart new topic

adding variable data to a confirmbutton extender

rgfirefly24
6 May, 2008 - 10:35 AM
Post #1

D.I.C Regular
Group Icon

Joined: 7 Apr, 2008
Posts: 330



Thanked: 5 times
Dream Kudos: 150
My Contributions
ok so i have a confirm button extender that i am using instead of Javascript (this was a 1.5 week nightmare) but i need to add data from a variable to it. Is this possible?
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Adding Variable Data To A Confirmbutton Extender
6 May, 2008 - 01:09 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,907



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Do you mean you want to add it into the ConfirmText property?
User is offlineProfile CardPM
+Quote Post

rgfirefly24
RE: Adding Variable Data To A Confirmbutton Extender
7 May, 2008 - 04:54 AM
Post #3

D.I.C Regular
Group Icon

Joined: 7 Apr, 2008
Posts: 330



Thanked: 5 times
Dream Kudos: 150
My Contributions
QUOTE(jayman9 @ 6 May, 2008 - 02:09 PM) *

Do you mean you want to add it into the ConfirmText property?


yes, i have a Session variable that i need to add to the ConfirmText property of the button using confirmbutton extender but when i mod the asp.net code to include it it still thinks of it as a string instead of a variable. I've tried it inside the quotes using escapes, single quotes, outside the quotes with a + concatination but none of that seems to work.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Adding Variable Data To A Confirmbutton Extender
7 May, 2008 - 07:41 AM
Post #4

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,907



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
How are you currently trying to assign the value from your session variable to the confirmbuttonextender?

It should be something like this:
CODE

ConfirmButtonExtender.ConfirmText = Sesssion["SomeName"].ToString();


Make sure you check to see if the Session variable is null before attempting this, otherwise if it is null, it will crash your application.
User is offlineProfile CardPM
+Quote Post

rgfirefly24
RE: Adding Variable Data To A Confirmbutton Extender
7 May, 2008 - 07:54 AM
Post #5

D.I.C Regular
Group Icon

Joined: 7 Apr, 2008
Posts: 330



Thanked: 5 times
Dream Kudos: 150
My Contributions
QUOTE(jayman9 @ 7 May, 2008 - 08:41 AM) *

How are you currently trying to assign the value from your session variable to the confirmbuttonextender?

It should be something like this:
CODE

ConfirmButtonExtender.ConfirmText = Sesssion["SomeName"].ToString();


Make sure you check to see if the Session variable is null before attempting this, otherwise if it is null, it will crash your application.


you are teh awsome! well for the most part tongue.gif it says there is no source code for this location, and attempted to find ConfirmButtonExtender.cs
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Adding Variable Data To A Confirmbutton Extender
7 May, 2008 - 08:13 AM
Post #6

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,907



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Where in your code are you attempting to do this??
User is offlineProfile CardPM
+Quote Post

rgfirefly24
RE: Adding Variable Data To A Confirmbutton Extender
7 May, 2008 - 08:17 AM
Post #7

D.I.C Regular
Group Icon

Joined: 7 Apr, 2008
Posts: 330



Thanked: 5 times
Dream Kudos: 150
My Contributions
QUOTE(jayman9 @ 7 May, 2008 - 09:13 AM) *

Where in your code are you attempting to do this??


CODE

    void BuildSession()
    {

        Connectto();

        String sqlretrieve = "sqlcommandthatworks";

        SqlCommand retrieve = new SqlCommand(sqlretrieve, connect);
        retrieve.Parameters.AddWithValue("@Country", ddlCountry.SelectedItem.ToString());

        int tmp = (int)retrieve.ExecuteScalar();
        Session["variable"] = "+" + tmp.ToString();

        Session["variable"] += " " + txtPhone.Text;

        Session["localvariable"] =  tmp.ToString();

        Session["localvariable"] +=  txtPhone.Text;
        
         if (Session["localvariable"] != "")
        {
    -> Confirmphone.ConfirmText = "Please confirm your phonenumber: " + Session["localvariable"].ToString();
        }
    }


this function is being called when a textbox autopostback is fired.

This post has been edited by rgfirefly24: 7 May, 2008 - 08:19 AM
User is offlineProfile CardPM
+Quote Post

rgfirefly24
RE: Adding Variable Data To A Confirmbutton Extender
7 May, 2008 - 08:56 AM
Post #8

D.I.C Regular
Group Icon

Joined: 7 Apr, 2008
Posts: 330



Thanked: 5 times
Dream Kudos: 150
My Contributions
hrm, ok so the toolkit is installed correctly, but it still wants the .cs file. .... i searched my computer for it and it cant find it.

This post has been edited by rgfirefly24: 7 May, 2008 - 10:16 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:46AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month