473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

insert message with overrides

TJS
I want to insert a message with an override if a condition exists but the
overrides does not kick in.
How do I invoke the overrides to display a message from my class code?

============Overrides code================
Protected Overrides Sub Render(writer As HtmlTextWriter)

if Application("idx") = true then
Dim vMessage As String = "message goes here"

'*** Render the page and retrieve into StringBuilder
Dim sb As New StringBuilder()
Dim hWriter As New HtmlTextWriter(New StringWriter(sb))
MyBase.Render(hWriter)

' *** store to a string
Dim PageResult As String = sb.ToString()
Dim At As Integer = PageResult.ToLower().LastIndexOf("")

If At > - 1 Then
PageResult = PageResult.Insert(At, vMessage)
End If

' *** Write it back to the server
writer.Write(PageResult)
end if

Return

End Sub 'Render
Nov 18 '05 #1
3 1107
Hi

I assume the code that you have sent is of a custom control that you are trying to build

So as you know the custom controls gets bundled in to a separate Assembly and to use them you have to register the
in the page that you use it

So this assembly knows nothing of the HttpContext

Try doing out this

1> Include the namespace System.Web

2> When you want to access the Application variables use the following
HttpContext.Current.Application(VarName

i hope this should solve your problem

Let me know on this
Nov 18 '05 #2
TJS
it was the HttpContext thingy

thanks
"kashypa" <lo*****@aztec.soft.net> wrote in message
news:07**********************************@microsof t.com...
Hi,

I assume the code that you have sent is of a custom control that you are trying to build.
So as you know the custom controls gets bundled in to a separate Assembly and to use them you have to register them in the page that you use it.

So this assembly knows nothing of the HttpContext.

Try doing out this.

1> Include the namespace System.Web.

2> When you want to access the Application variables use the following
HttpContext.Current.Application(VarName)

i hope this should solve your problem.

Let me know on this

Nov 18 '05 #3
Hey

Thats good man

Happy that i could be of some help 2 u
Nov 18 '05 #4

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

Similar topics

4
by: Christopher W. Douglas | last post by:
I am developing a VB.NET app using Visual Studio.NET 2003. VB.NET allows me to create a class with two or more methods that have the same name, as long as they have different (non-optional)...
5
by: Rick Spiewak | last post by:
I need to generate a "buy" button as part of an ASP.NET page - this consists of a small HTML form with hidden fields, conforming to the requirements of a merchant credit card processor. PayPal is...
9
by: Surrealist | last post by:
I need something likes as when I create an event procedure. I can use top-left and top-right dropdown list of code editor to select object and its exposed events respectively. Then, the IDE,...
10
by: Atif | last post by:
Hi I am here to solve a small confusion i have in "Overloads Overrides". "Overloading" says that the method's name should be same while no. of parameters and/or their datatypes should be changed...
2
by: Kalvin | last post by:
I found some code in Google, don't remember where, for an AutoComplete combobox. Everything is great with it except for one thing. If I use the mouse to drop the list down, then start typing to...
2
by: Not Me | last post by:
Hi, I've seen this prob in a few places but the explanations/solution wasn't up to my understanding! I have a detailsview, with an insert button that works fine when there is already data in...
1
by: Pieter | last post by:
Hi, I have a custom List that inherits from BindingList. It has some methods overloaded, like the Add/Insert/etc to add and remove some eventhandlers when adding or removing an item T of the...
5
by: J055 | last post by:
Hi How do I keep the values of the controls in a FormView after a PostBack in Insert mode? Thanks Andrew
0
by: =?Utf-8?B?ZWQ=?= | last post by:
I had this exact problem using a vb.net client accessing a Java web service. The solution takes 3 steps: 1.) Create custom ClientOutputFilter 2.) Create a custom Assertion that uses filter from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.