473,769 Members | 3,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clear data(html) in a usercontrol

Hi,

When I load a userControl, I check if I have a variable session.

If my variableSession 1 = "A" and do nothing.

but if my variableSession 1 = "B", I want clear the html in my control
and write:

"You need to do this or that"

If I use this code:

Current.Session .Abandon()
Current.Respons e.Write("<TABLE width=""100%""> " & _
"<TR align=""center" "><TD><H2>Y ou
need to do this or that"</H2></TD></TR>"
</TABLE>")
Current.Respons e.End()

all my page is "cleared".

How to clear only the code in my userControl ?

Thanks,
David

Mar 21 '07 #1
2 1343
<bo**********@g mail.comwrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.com.. .

Have you tried:

<MyUserControl> .Controls.Clear ();
Mar 21 '07 #2
On Mar 21, 8:45 am, boomcreat...@gm ail.com wrote:
Hi,

When I load a userControl, I check if I have a variable session.

If my variableSession 1 = "A" and do nothing.

but if my variableSession 1 = "B", I want clear the html in my control
and write:

"You need to do this or that"

If I use this code:

Current.Session .Abandon()
Current.Respons e.Write("<TABLE width=""100%""> " & _
"<TR align=""center" "><TD><H2>Y ou
need to do this or that"</H2></TD></TR>"
</TABLE>")
Current.Respons e.End()

all my page is "cleared".

How to clear only the code in my userControl ?

Thanks,
David
You can wrap the controls in your UserControl in a PlaceHolder and
then set the PlaceHolder Visible property to true or false depedning
on your session variable. Then you would have another PlaceHolder or
Label for your "Do this" text and use the Visible property on that to
control it as well.

Mar 21 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2027
by: asim | last post by:
Hi All i m transforming a simple XSL file on Server side using MSXML Parser ... and writting resultant HTML directly on browser .. is there any way to get this HTML in a variable ??? i seen the article on MSDN but it makes my page blank ... plz edit my code to make is work in this manner, if possible Thankx in advance Plz Help
2
1785
by: Econ | last post by:
XML as part of HTML in different browsers In one folder are few files - XML - file with data - HTML - file with static text - XSL - file for transformation XML data into HTML - CSS - CascadeStyleSheet +-HTML----------------------------+ | |
1
16082
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason is for the sake of security. What does that mean ?
1
8042
by: teknowbabble | last post by:
I would like to know how to convert HTML code that users input into a TEXTAREA box on a HTML FORM into a separate WEBPAGE. I have something like the diagram below on my webpage. The user is prompted to input his/her HTML Code in the FORM TEXTAREA. By pushing the Make Webpage Button, a new window opens with the output of the HTML contents they inputted. This way people can see what their HTML looks like. HTML FORM TEXTAREA (Where user...
1
1907
by: Peter | last post by:
Team .Net, I'm looking for a component or anything that will alow me to take string data formated in HTML and convert it to a pdf. I have browsed throught the compnonet shopper and have not yet found a single program that will accomplish this task? Any ideas? -Peter
15
33460
by: tmax | last post by:
PHP Pros: I have a simple html form that submits data to a php script, which processes it, and then redisplays the same page, but with a "thank you" message in place of the html form. This is all working fine. However, when refresh the browser, I get the following message displayed: "The page you are trying to view contains POSTDATA. If you resend the data, any action the form carried out (such as as search or online purchse) will...
3
1905
by: vunet.us | last post by:
Hello, I am breaking my head running out of ideas about the best solution to my goal. I want to load some pages generated with the server (ASP) and assign their html results to JavaScript, so users could click the links and the content of any selected page would show up immediately, making no requests. So, I have one main page called mainpage.asp which, I think, should get all subpages with content, names are subpage1.asp, subpage2.asp,...
15
5276
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
33
2295
by: MC | last post by:
Hey, I have a need to get HTML from a client back to a server to do server processing. I would like the HTML and form data both. Is there a simple way to capture that? I do not want to submit the page...I will use ajax to send the data. I know how to get the elements but not the entire page or form. I am really just interested in specifying document.form2 and sending that.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.