|
You must save and load viewstate manually. Here comes an example of an HtmlSelect. Reason for the control was, if I have many, many values in control, the viewstate is bloat. Now I save only active value in viewstate and set set users choice during postback.
Imports System.ComponentModel
Imports System.Web.UI
Namespace MyOwnWebControls
<DefaultProperty("Text"), ToolboxData("<{0}:MyOwnHtmlSelect runat=server></{0}:MyOwnHtmlSelect>")> Public Class MyOwnHtmlSelect
Inherits System.Web.UI.HtmlControls.HtmlSelect
Dim m_text As String = ""
<Bindable(True), Category("Appearance"), Description("current content"), DefaultValue("")> Property Text() As String
Get
Return m_text
End Get
Set(ByVal Value As String)
m_text = Value
End Set
End Property
Protected Overrides Function SaveViewState() As Object
' make an array with dimension 2
Dim savedState(1) As Object
Try
' doesn't work
' savedState(0) = Me.Value
' savedState(1) = Me.Text
' this works - juhu
If Me.Items.Count > Me.SelectedIndex Then
savedState(0) = Me.Items(Me.SelectedIndex).Value
savedState(1) = Me.Items(Me.SelectedIndex).Text
Else
savedState(0) = ""
savedState(1) = ""
End If
Catch err As System.Exception
' Do some errormessage here
End Try
Return savedState
End Function
Protected Overrides Sub LoadViewState(ByVal savedState As Object)
Try
If Not savedState Is Nothing Then
' get the old values
Dim value As String = savedState(0)
Dim text As String = savedState(1)
' get value from the site
If Not Page.Request.Form(ID) Is Nothing Then
' set new value
value = Page.Request.Form(ID)
If value <> savedState(0) Then
' if the selection changed clear the text
text = ""
End If
Else
' can be nothing - for example the pt is disabled than it is not sent back to the server
' in this case we take the old value from VIEWSTATE because the user can't change the selected item
End If
' set the value of the poptext to the value of the selected item
Me.Value = value
' add one item with this value
Me.Items.Add(New System.Web.UI.WebControls.ListItem(text, value))
Me.SelectedIndex = 0
End If
Catch err As System.Exception
' Do some errormessages here
End Try
End Sub
End Class
End Namespace
Regards
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
|
Hi, i'm using mail works pro to send out newsletters for my site. Because i'm using a free internet host it has smtp disabled and i can't use the mail() function.
Can someone tell me how i can change all the php code so it uses my smtp gmail host?
Please help..
|
|
|
|
|
So how many of you guys use google personalized home page
They have added tab feature recently which is quite cool,
I added some categories and it looks like this here[^]
Thoughts ?
-- moved at 22:37 Tuesday 19th September, 2006
|
|
|
|
|
|
you mean nobody uses/cares google personalized homepage ?
|
|
|
|
|
Most of the people I know don't care or use the Google personalized homepage or for that matter any of the 9 million personalized homepage websites out there.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
Quartz... wrote: you mean nobody
only speaking (sleeping) for myself.
led mike
|
|
|
|
|
Why didn't you just post a link to the page itself?
Part of me thinks that you're hoping to drum up traffic for your new interview site by posting a link to an image hosted on the same server as said Web site and hoping that this ploy is enough to pique the interest of your viewers and maybe, just maybe, they'll erase the non-essential bits from the URL and see what interviewinfo.net is all about.
The rest of me doesn't undertand your fascination with Google Pages when you clearly have the programming[^] chops[^] to create cool stuff[^] on your own.
Quartz... wrote: Thoughts ?
Maybe I'm reading too much into it. Maybe that's because I am grumpy because I'm developing with VS2003 on a Win2k3 Std. box with SQL Server 2000... and only 512 MB of RAM. Maybe it's because my city's sanitation workers have been on strike for 2 weeks. Or maybe it's because today is Int'l Talk Like a Pirate Day and I just felt like being an AAARRRRse.
|
|
|
|
|
Jon Sagara wrote: Why didn't you just post a link to the page itself?
The page is google.com
You just have to login and personalize the page. The screenshot is of the google home page after personalization.
there is no new service or site for which i can give a link or URL
Jon Sagara wrote: Part of me thinks that you're hoping to drum up traffic for your new interview site by posting a link to an image hosted on the same server as said Web site and hoping that this ploy is enough to pique the interest of your viewers and maybe, just maybe, they'll erase the non-essential bits from the URL and see what interviewinfo.net is all about.
This is very interesting
A very unique thing has happened after i first posted a message asking for suggestion about my new website interviewinfo,
everytime i post a message it becomes grey , becoming misfamous
Well in my opinion, Code Project - lounge specifically is not a section of the site for people looking for a job and interview tips.
Only those guys can afford to spend time at the lounge who have a well settled job and extra time from there jobs.
But cpians didn't liked that post so i did not even added it to my sig. which i should have done do if i really wanted to get traffic there from code project lounge. i have another project protrack which i think is more suitable for the kind of users at the lounge which is also there in my sig.
Jon Sagara wrote: The rest of me doesn't undertand your fascination with Google Pages when you clearly have the programming[^] chops[^] to create cool stuff[^] on your own.
I liked the new feature about google add tabs, its damn innovatif as well as usefull
Anyway nice to know your opinion about me
|
|
|
|
|
Quartz... wrote: The page is google.com
You just have to login and personalize the page. The screenshot is of the google home page after personalization.
there is no new service or site for which i can give a link or URL
My bad. I thought you were referring to Google Page Creator[^], and for the life of me, I couldn't understand why you were so enthralled by it, and why you didn't just post a link to your page. Now I know.
Quartz... wrote: I liked the new feature about google add tabs, its damn innovatif as well as usefull
Fair enough.
|
|
|
|
|
Quartz... wrote: I liked the new feature about google add tabs, its damn innovatif as well as usefull
How? I wouldn't really say that's useful at all. If I'm going to customize a page to have everything I want to see when I start my web browser, I'm going to find a way of cramming every last piece of information I want on one, non-scrolling, non-tabbed page.
As far as innovative...tabs have been around since the beginning of time. I'm not quite sure how this can possibly be defined as innovative.
Once you wanted revolution Now you're the institution How's it feel to be the man?
|
|
|
|
|
Well that definetly means one thing
You don't like and ofcourse not use google personalized page.
Those who do use them will find this feature quite useful , for me i used to have all kinds of blogs /news/ msdn stuffs all crammed in one page , So implementation of dynamic tabs (which i think is an innovative because of its implementation in google personalized page) cleared the clutter and helped me categorize everything as i showed in the screeshot , and i can use all of the items without scrollbar so i am happy with it
if you are addicted to something, like code project, any new feature like latest thread box in the top right corner will seem to be innovative and useful, thats how i see it
|
|
|
|
|
Quartz... wrote: You don't like and ofcourse not use google personalized page.
Ya think?
Quartz... wrote: any new feature like latest thread box in the top right corner will seem to be innovative and useful,
Eh. I dunno. I rarely look at it. It'd be more innovative and useful for me to have, say, an in-page rich text reply form, or keyboard navigation, or auto-forum-refresh. That's pretty cool stuff.
Once you wanted revolution Now you're the institution How's it feel to be the man?
|
|
|
|
|
Hi, all:
I'm developing a feature for our software which can block a list of websites. For internet explorer, I chose the BHO technology. I've written a little BHO.dll which is loaded when internet explorer is launched. When user types a website address in the address bar and hit enter, I check the address to find out whether it is in the block list. If in the list, the internet explorer will be directed to a simple page containing "this website is blocked."
It works and I get desired feature.
But BHO.dll is loaded into each internet explorer's address space and it sometimes conflicts with IE. Maybe it's not a good method.
I notice IWebBrowser2 can also implement my feature. Then, to my feature, which one is better?
I have to think about firefox and other IE-cored web browser. Where can I find some help to implement my feature?
Thank you very much!
|
|
|
|
|
Suppose there's a paragraph on the page which contains several lines of words. How can I highlight those words one by one, from the first one to the last one? It's just like reading through the paragraph.
I think I have to use TextRange object and its getClientRects method.
Could anyone help me? Very appreciate.
Thanks
Jie
Edit/Delete Message
|
|
|
|
|
Hello all,
Sub: Duplicate Mails - Generated on press of Refresh button in Browser.
HOW TO VALIDATE THIS IN ASP not ASP.NET.
We created a application code using asp vb script which sent mail with attachment once the people proceeds for order.
The problem we are facing is we are getting duplicate mail after once we refresh the confirm button.
so we are getting more mails when ever we refresh the pages. This should be stopped.
Please advice.
Thanks and Regards,
kris
If you fail for the first time , call it version 1.0.
|
|
|
|
|
Could you stick a MailSent flag in the database whenever the confirmation mail has been sent and then don't send any further mails after that?
|
|
|
|
|
Thanks for the attention ..
but i am afraid that is not an option because we are not
permitted to alter the database which is stabilised and is
replicated elsewhere.
I have to find out a solution from the fromt end..
may be browser related or something like that..
If you fail for the first time , call it version 1.0.
|
|
|
|
|
i have server control named "ddl_xx" and i am having the list of countries in it(includes an item 'Others').If the user Choose others, there is a "txt_others" textbox.
i need to validate when the user choose others in "ddl_xx" the txt_others should not empty?
I have used custom validator
and i have coded as follows in javascript and called the function in custom validator control by setting the property client validation with javascript function name...
function ddl_PCountry_val(oSrc,args)
{
alert("dd");
if (args.Value=="-Select-" || args.Value=="")
{
args.IsValid=false;
}
else if (args.Value=="Others")
{
if(document.Form1.txt_Other_PCountry.value=="")
{
args.IsValid=false;
}
else
{
args.IsValid=true;
}
}
else
{
args.IsValid=true;
}
}
Problem: Java script function is not called when the page is submitted
Jesuraj
|
|
|
|
|
from where you are calling the script?
Have you give the proper name withought spelling mistake??
Arte the values of the parameters are catching in the function??
Just alert them in the beginning.
|
|
|
|
|
ya thank u
i got it.
i didn't bind the value property of "ddl_Cntrl" while bind the country names to it.
so the custom validator not getting the args.Value correctly
thank u very much for ur reply
Jesuraj
|
|
|
|
|
Hello, I"m not really sure if i'm in the right forum. If you can direct me to the right forum, I will just have it posted again. Thanks!
I am accessing my rdl file in a user control which accepts parameters. Is it possible to combine rdl (controls accepting parameters) and my own user defined controls inside the usercontrol?
How do I add parameters taken from my usercontrol controls when clicking 'VIew Reports' from the .rdl?
Thanks!
|
|
|
|
|
I'm working in Visual Studio 2003 and I'm trying to add a web project to a solution. When I right-click on the solution and select "Add Existing Project From Web," I get a dialog that
says "Enter the URL of the server that you want to add the project from:" that is prepopulated
with "http://localhost."
When I click "OK," the "Add Existing Project" dialog comes up with the "localhost" folder selected, showing all my virtual folders. I then double click my virtual folder, and expect to see the project files (*.csproj). Instead I see nothing, but the project file is present in the folder. If I type in the URL to the project file, I get a message saying that "Documents in this folder are not available.
I have tried re-installing ASP.NET on IIS with ASPNET_regiis, to no avail. Please help.
|
|
|
|
|
try "Add Existing Project" instead if you have a project-file (.csproj) in your web-app. This should do
|
|
|
|