messagebox for form validation purposes to work via ASPX & code-behind
VB.
What an incredibly stupid omission/oversight on the part of the .Net
developers.
We sure got some sexy XML stuff going though! Incredible.
Marketing over substance. Good job Billy.zamdrist@.gmail.com wrote:
> I can't believe the machinations one must go through to get a simple
> messagebox for form validation purposes to work via ASPX & code-behind
> VB.
> What an incredibly stupid omission/oversight on the part of the .Net
> developers.
Zamdrist,
A MessageBox in code-behind would cause the dialog to appear on the Web
server. In ASP.NET, code executes on the Web server. If you want a dialog
to appear on the client, you have to do it with script in the browser.
Actually, ASP.NET built-in validation does a good job of this without much
effort at all on your part. Perhaps you could post some specifics about
what kind of problem you're having.
--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003
"zamdrist@.gmail.com" <zamdrist@.gmail.com> wrote in
news:1126032259.518276.247770@.g47g2000cwa.googlegr oups.com:
> I can't believe the machinations one must go through to get a simple
> messagebox for form validation purposes to work via ASPX & code-behind
> VB.
Were you trying to add your own custom messages to the form validation box?
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Ah, thank you for reading between the lines, and gleaning my cry for help
amongst the criticism. :)
What I would like to accomplish is this. I have a radio button list, a
textbox and a submit button.
The radio button list are values 1-5. If the user select 3 or less, then
'comments' in the textbox are required.
I was hoping (foolishly) that I could say something to the effect:
If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
msgbox "A rating of 3 or less requires you to supply comments"
Exit Sub
End If
That is just a rough explanation of what I need to do. Pretty simple. I
shouldn't have to use an extraneous
Thanks...
Steve
"JIMCO Software" <contactus@.jimcosoftware.com> wrote in message
news:OCRLEQxsFHA.3640@.tk2msftngp13.phx.gbl...
> zamdrist@.gmail.com wrote:
> > I can't believe the machinations one must go through to get a simple
> > messagebox for form validation purposes to work via ASPX & code-behind
> > VB.
> > What an incredibly stupid omission/oversight on the part of the .Net
> > developers.
> Zamdrist,
> A MessageBox in code-behind would cause the dialog to appear on the Web
> server. In ASP.NET, code executes on the Web server. If you want a
dialog
> to appear on the client, you have to do it with script in the browser.
> Actually, ASP.NET built-in validation does a good job of this without much
> effort at all on your part. Perhaps you could post some specifics about
> what kind of problem you're having.
> --
> Jim Cheshire
> JIMCO Software
> http://www.jimcosoftware.com
> FrontPage add-ins for FrontPage 2000 - 2003
>
Steve Schroeder wrote:
> Ah, thank you for reading between the lines, and gleaning my cry for
> help amongst the criticism. :)
> What I would like to accomplish is this. I have a radio button list, a
> textbox and a submit button.
> The radio button list are values 1-5. If the user select 3 or less,
> then 'comments' in the textbox are required.
> I was hoping (foolishly) that I could say something to the effect:
> If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
> msgbox "A rating of 3 or less requires you to supply comments"
> Exit Sub
> End If
In that case, you would need to use the CustomValidator and write your own
client-side code. No way around it.
--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003
A simple solution is to have a label with bold red text, etc. When the page
load, set the Visible = False.
In your "If" statement below, instead of MsgBox, set the Visible = True
"Steve Schroeder" <sschroeder@.somewhere.com> wrote in message
news:e34XBXxsFHA.460@.TK2MSFTNGP15.phx.gbl...
> Ah, thank you for reading between the lines, and gleaning my cry for help
> amongst the criticism. :)
> What I would like to accomplish is this. I have a radio button list, a
> textbox and a submit button.
> The radio button list are values 1-5. If the user select 3 or less, then
> 'comments' in the textbox are required.
> I was hoping (foolishly) that I could say something to the effect:
> If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
> msgbox "A rating of 3 or less requires you to supply comments"
> Exit Sub
> End If
> That is just a rough explanation of what I need to do. Pretty simple. I
> shouldn't have to use an extraneous
> Thanks...
> Steve
> "JIMCO Software" <contactus@.jimcosoftware.com> wrote in message
> news:OCRLEQxsFHA.3640@.tk2msftngp13.phx.gbl...
>> zamdrist@.gmail.com wrote:
>> > I can't believe the machinations one must go through to get a simple
>> > messagebox for form validation purposes to work via ASPX & code-behind
>> > VB.
>>> > What an incredibly stupid omission/oversight on the part of the .Net
>> > developers.
>>>
>> Zamdrist,
>>
>> A MessageBox in code-behind would cause the dialog to appear on the Web
>> server. In ASP.NET, code executes on the Web server. If you want a
> dialog
>> to appear on the client, you have to do it with script in the browser.
>>
>> Actually, ASP.NET built-in validation does a good job of this without
>> much
>> effort at all on your part. Perhaps you could post some specifics about
>> what kind of problem you're having.
>>
>> --
>> Jim Cheshire
>> JIMCO Software
>> http://www.jimcosoftware.com
>>
>> FrontPage add-ins for FrontPage 2000 - 2003
>>
>>
>>
>>
Thank you all for your suggestions.
I do think it's quite pathetic there is no practical means to perform
this very routine event (pop-up message box).
For all its grandeur, ASP.Net can't even do what windows forms have
been doing for years and years.
Again, thank you for the suggestions.
Steve
zamdrist@.gmail.com wrote:
> For all its grandeur, ASP.Net can't even do what windows forms have
> been doing for years and years.
ASP.NET is restricted by the fact that it executes on a server that is
disconnected from the client. Windows applications are not. This is not a
limitation of ASP.NET. It's merely part of the architecture of Web
applications.
--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003
If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
response.write("<script language=""javascript"")alert(""A rating of 3 or
less requires you to supply comments"");</script>")
exit sub
end if
"Steve Schroeder" <sschroeder@.somewhere.com> wrote in message
news:e34XBXxsFHA.460@.TK2MSFTNGP15.phx.gbl...
> Ah, thank you for reading between the lines, and gleaning my cry for help
> amongst the criticism. :)
> What I would like to accomplish is this. I have a radio button list, a
> textbox and a submit button.
> The radio button list are values 1-5. If the user select 3 or less, then
> 'comments' in the textbox are required.
> I was hoping (foolishly) that I could say something to the effect:
> If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
> msgbox "A rating of 3 or less requires you to supply comments"
> Exit Sub
> End If
> That is just a rough explanation of what I need to do. Pretty simple. I
> shouldn't have to use an extraneous
> Thanks...
> Steve
> "JIMCO Software" <contactus@.jimcosoftware.com> wrote in message
> news:OCRLEQxsFHA.3640@.tk2msftngp13.phx.gbl...
> > zamdrist@.gmail.com wrote:
> > > I can't believe the machinations one must go through to get a simple
> > > messagebox for form validation purposes to work via ASPX & code-behind
> > > VB.
> > > > What an incredibly stupid omission/oversight on the part of the .Net
> > > developers.
> > > Zamdrist,
> > A MessageBox in code-behind would cause the dialog to appear on the Web
> > server. In ASP.NET, code executes on the Web server. If you want a
> dialog
> > to appear on the client, you have to do it with script in the browser.
> > Actually, ASP.NET built-in validation does a good job of this without
much
> > effort at all on your part. Perhaps you could post some specifics about
> > what kind of problem you're having.
> > --
> > Jim Cheshire
> > JIMCO Software
> > http://www.jimcosoftware.com
> > FrontPage add-ins for FrontPage 2000 - 2003
sorry, should be
If rblList.SelectedItem.Value <= 3 And txtComments.Text = string.empty Then
> response.write("<script language=""javascript"")alert(""A rating of 3 or
> less requires you to supply comments"");</script>")
> exit sub
> end if
"Clamps" <Clamps@.Spamless.com> wrote in message
news:OnQMSRysFHA.2792@.tk2msftngp13.phx.gbl...
> If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
> response.write("<script language=""javascript"")alert(""A rating of 3 or
> less requires you to supply comments"");</script>")
> exit sub
> end if
>
> "Steve Schroeder" <sschroeder@.somewhere.com> wrote in message
> news:e34XBXxsFHA.460@.TK2MSFTNGP15.phx.gbl...
> > Ah, thank you for reading between the lines, and gleaning my cry for
help
> > amongst the criticism. :)
> > What I would like to accomplish is this. I have a radio button list, a
> > textbox and a submit button.
> > The radio button list are values 1-5. If the user select 3 or less, then
> > 'comments' in the textbox are required.
> > I was hoping (foolishly) that I could say something to the effect:
> > If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
> > msgbox "A rating of 3 or less requires you to supply comments"
> > Exit Sub
> > End If
> > That is just a rough explanation of what I need to do. Pretty simple. I
> > shouldn't have to use an extraneous
> > Thanks...
> > Steve
> > "JIMCO Software" <contactus@.jimcosoftware.com> wrote in message
> > news:OCRLEQxsFHA.3640@.tk2msftngp13.phx.gbl...
> > > zamdrist@.gmail.com wrote:
> > > > I can't believe the machinations one must go through to get a simple
> > > > messagebox for form validation purposes to work via ASPX &
code-behind
> > > > VB.
> > > > > > What an incredibly stupid omission/oversight on the part of the .Net
> > > > developers.
> > > > > > Zamdrist,
> > > > A MessageBox in code-behind would cause the dialog to appear on the
Web
> > > server. In ASP.NET, code executes on the Web server. If you want a
> > dialog
> > > to appear on the client, you have to do it with script in the browser.
> > > > Actually, ASP.NET built-in validation does a good job of this without
> much
> > > effort at all on your part. Perhaps you could post some specifics
about
> > > what kind of problem you're having.
> > > > --
> > > Jim Cheshire
> > > JIMCO Software
> > > http://www.jimcosoftware.com
> > > > FrontPage add-ins for FrontPage 2000 - 2003
> > > >
Clamps wrote:
> sorry, should be
> If rblList.SelectedItem.Value <= 3 And txtComments.Text =
> string.empty Then
>> response.write("<script language=""javascript"")alert(""A rating of
>> 3 or less requires you to supply comments"");</script>")
>> exit sub
>> end if
I think he wants to validate this on the client.
--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com
FrontPage add-ins for FrontPage 2000 - 2003
Steve Schroeder wrote:
> I was hoping (foolishly) that I could say something to the effect:
> If rblList.SelectedItem.Value <= 3 And txtComments.Text = "" Then
> msgbox "A rating of 3 or less requires you to supply comments"
> Exit Sub
You can. Observe:
<asp:CustomValidator ControlToValidate=txtWhatever
ClientValidationFunction="yourPopupValidator()"
EnableClientScript=True
Runat=server/
<script>
function yourPopupValidator(e)
{
if (document.forms[0].rbWhatever.checked)
{
alert("denied!");
e.IsValid = false;
}
else
{
e.IsValid = true;
}
}
</script
Further, if you don't like the way ASP.NET handles client-side
validation, you are free to roll your own. It's still HTML. You can
paste in whatever you were using in your previous life and it will work
equally well.
ASP.NET hasn't made anything harder for you. At worst it can only have
made you lazier.
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Hi Steve,
> I do think it's quite pathetic there is no practical means to perform
> this very routine event (pop-up message box).
It certainly is routine. However, don't you think it's quite pathetic that,
rather than creating your own function to do something like this, you
complain because Microsoft hasn't? A good programmer can write his own
tools. But never mind that; here's one of mine:
/// <summary>
/// Adds a JavaScript "alert()" with Message to Page Startup
/// </summary>
/// <param name="Message">Message to display</param>
/// <param name="UniqueScriptName">Unique Name to use when registering
script in Page</param>
public static void MsgBox(string Message, string UniqueScriptName)
{
StringBuilder s;
System.Web.UI.Page p;
try
{
if (HttpContext.Current == null) return;
s = new StringBuilder("<script type=\"text/javascript\">" +
Environment.NewLine +
"<!--" + Environment.NewLine);
s.Append("alert('" + Message.Replace("\"", "\\\"") + "');" +
Environment.NewLine + "// --></script>");
p = (System.Web.UI.Page) HttpContext.Current.Handler;
if (!(p.IsStartupScriptRegistered("MsgBox")))
p.RegisterStartupScript(UniqueScriptName, s.ToString());
}
catch (Exception ex)
{
HandleError(ex);
}
}
/// <summary>
/// Adds a JavaScript "alert()" with Message to Page Startup
/// </summary>
/// <param name="Message">Message to display</param>
public static void MsgBox(string Message)
{
MsgBox(Message, "MsgBox");
}
Note: You will have to come up with your own custom Exception Handler, or
just throw the Exception if you like.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
<zamdrist@.gmail.com> wrote in message
news:1126037594.191002.85650@.o13g2000cwo.googlegro ups.com...
> Thank you all for your suggestions.
> I do think it's quite pathetic there is no practical means to perform
> this very routine event (pop-up message box).
> For all its grandeur, ASP.Net can't even do what windows forms have
> been doing for years and years.
> Again, thank you for the suggestions.
> Steve
Well, a really good programmer wouldn't need an IDE.
A really, really good programmer should only write C++ code using vi.
Gimme a break.
Kevin Spencer wrote:
> Hi Steve,
> > I do think it's quite pathetic there is no practical means to perform
> > this very routine event (pop-up message box).
> It certainly is routine. However, don't you think it's quite pathetic that,
> rather than creating your own function to do something like this, you
> complain because Microsoft hasn't? A good programmer can write his own
> tools. But never mind that; here's one of mine:
> A really, really good programmer should only write C++ code using vi.
Bulls**t. That is not a logical comparison. An IDE is a productivity tool.
Assuming that IDEs are already out there and available to the developer,
using one is a good idea. Assuming that a function is already out there and
available to the developer. Using one is a good idea, rather than writing
one for one's self. However, assuming that such a function is not available,
one does not blame Microsoft, calling the company that didn't provide that
particular function "pathetic." That solves nothing, and is therefore not a
logical response to the problem. One writes one for one's self, and adds it
to their toolbox.
Every good developer that I know has a collection of tools that he or she
has either written or collected, for use in other projects. I have half a
dozen class libraries of my own that I re-use constantly, along with the
..Net CLR, and every good developer that I know of has something similar. I
also have additional programming tools that perform tasks that Visual Studio
does not. This too is logical
It is no more "pathetic" that Microsoft doesn't have every function and
every tool available in the Visual Studio.Net package than it is "pathetic"
that Ford does not include OnStar in every car they manufacture. You buy the
product as is, not as you wish it were, and you pay for what you get, not
what you wish for. And that is also logical.
Logic is the substance of a programmer's task. Lack of logic is a hindrance
to any programmer.
> Gimme a break.
I did. I gave you my function. That was not logical, but simply charitable.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
<zamdrist@.gmail.com> wrote in message
news:1126097914.102300.250210@.f14g2000cwb.googlegr oups.com...
> Well, a really good programmer wouldn't need an IDE.
> A really, really good programmer should only write C++ code using vi.
> Gimme a break.
> Kevin Spencer wrote:
>> Hi Steve,
>>
>> > I do think it's quite pathetic there is no practical means to perform
>> > this very routine event (pop-up message box).
>>
>> It certainly is routine. However, don't you think it's quite pathetic
>> that,
>> rather than creating your own function to do something like this, you
>> complain because Microsoft hasn't? A good programmer can write his own
>> tools. But never mind that; here's one of mine:
Kevin,
Firstly, I do appreciate your assistance and I apologize for not making
that clear. It appears I can perform what I need to do using various
methods, including the family of validation controls if I so desire.
I do wish to make the point however that these contortions one must go
through to simply display a notice on the screen is ridiciulous IMHO. I
understand the reasons why, as the client-server sturcture of ASP.Net
does not allow for it, and other ways must be found. It just seems like
an awful lot to go through, just to notify the user they haven't filled
out the form completely.
I shouldn't be spending time trying to figure out how to work around
the limitations of ASP.Net, I should be spending it writing buisness
logic code.
That is my point.
ASP.Net certainly does have its "limitations" (perhaps "fixed requirements"
would be a better term). It is very actually very flexible, however, and
designed to accomodate a large variety of developement and user interface
styles. OOP in general has a way of causing the developer to go slowly at
first, and gain productivity as one continues. It's mostly a matter of
deciding first what particular design model one wants to go with, developing
a custom library of classes, and extending/expanding these as one goes
along. It requires a good bit more thinking up-front, and in particular a
lot of attention to design. It also tends to require one to develop one's
own methodology, and the classes that can aid one in the execution of that
design and methodology.
In other words, the building blocks that Microsoft provides are not intended
as all the possible tools that one could possibly use in developing any kind
of web site, but a number of low- and intermediate-level tools that one can
combine into customized tools for designing specific types of applications,
as there are so many of them. In addition, the ASP.Net class libraries
contain a number of pre-built Controls for both beginners and for
commonly-encountered types of functionality. They were not intended for (nor
could they be) a set of comprehensive tools for building any type of app.
Validation controls are an excellent example. Talk about limitations! For
our applications, we provide our own validation methodology, and have built
a number of custom Controls and methods for implementing it. Again, it took
a bit of time up front, but now we have a consistent model which can be used
in any of our apps.
It takes a bit of getting used to, but it can be fun in the long run!
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
<zamdrist@.gmail.com> wrote in message
news:1126111057.477973.114390@.g47g2000cwa.googlegr oups.com...
> Kevin,
> Firstly, I do appreciate your assistance and I apologize for not making
> that clear. It appears I can perform what I need to do using various
> methods, including the family of validation controls if I so desire.
> I do wish to make the point however that these contortions one must go
> through to simply display a notice on the screen is ridiciulous IMHO. I
> understand the reasons why, as the client-server sturcture of ASP.Net
> does not allow for it, and other ways must be found. It just seems like
> an awful lot to go through, just to notify the user they haven't filled
> out the form completely.
> I shouldn't be spending time trying to figure out how to work around
> the limitations of ASP.Net, I should be spending it writing buisness
> logic code.
> That is my point.
Well I appreciate your thoughts. They are obviously well thought out
and you've gone to some length to explain what you think the
methodology behind programming in ASP.Net is.
Do you however, really think the inclusion of messagebox functionality
is overly-comprehensive? I don't believe it is. Especially when you
think of Web Forms as forms of any kind and of virtually any use. More
and more I am moving functionality for the processes I write to our
Intranet and ASP.Net.
My issue wasn't so much the validation issue. That in itself it easy.
If rblOrg.SelectedItem.Value <= 3 Then...Else End If
It's facilitating notifying the user they haven't completed the form
that I'm struggling with. Just by instinct and previous experience I
looked towards the messagebox. Why wouldn't I? But that's really not a
viable option. I will instead change the border color of the required
field to red and make visible a label who warns the user not all
information was entered. Hokey really, but thats what I have to work
with.
Thanks for your time,
Steve
Presumably you've chosen a web technology like ASP.NET because it
offers benefits like ease of deployment (the client just need a web
browser). Perhaps you need to reevaluate the tradeoffs?
--
Scott
http://www.OdeToCode.com/blogs/scott/
On 7 Sep 2005 09:37:37 -0700, "zamdrist@.gmail.com"
<zamdrist@.gmail.com> wrote:
>Kevin,
>Firstly, I do appreciate your assistance and I apologize for not making
>that clear. It appears I can perform what I need to do using various
>methods, including the family of validation controls if I so desire.
>I do wish to make the point however that these contortions one must go
>through to simply display a notice on the screen is ridiciulous IMHO. I
>understand the reasons why, as the client-server sturcture of ASP.Net
>does not allow for it, and other ways must be found. It just seems like
>an awful lot to go through, just to notify the user they haven't filled
>out the form completely.
>I shouldn't be spending time trying to figure out how to work around
>the limitations of ASP.Net, I should be spending it writing buisness
>logic code.
>That is my point.
Sorry for jumping in so late. I agree that there are numerous limitations in
the ASP.NET validators and it caused me to create a commercial replacement,
Professional Validation And More (http://www.peterblum.com/vam/home.aspx).
Adding alerts is built in, whether when you submit, change the value and tab
off, or click on an image where the error message goes, to show the error
message in the messagebox.
I published a detailed list of the limitations in the original validators
that I've found and addressed at http://www.peterblum.com/vam/valmain.aspx.
I've also published an article to educate users to use the original
validators better: http://aspalliance.com/699.
-- Peter Blum
www.PeterBlum.com
Email: PLBlum@.PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
<zamdrist@.gmail.com> wrote in message
news:1126032259.518276.247770@.g47g2000cwa.googlegr oups.com...
>I can't believe the machinations one must go through to get a simple
> messagebox for form validation purposes to work via ASPX & code-behind
> VB.
> What an incredibly stupid omission/oversight on the part of the .Net
> developers.
> We sure got some sexy XML stuff going though! Incredible.
> Marketing over substance. Good job Billy.
zamdrist@.gmail.com wrote:
> I do wish to make the point however that these contortions one must go
> through to simply display a notice on the screen is ridiciulous IMHO.
What are you talking about? It's a single line of code:
alert("this only took one line of code");
You just have to run it on the client. Complaining that it's hard to
run client-side code from a web server just makes you sound like an
idiot. Kevin was 100% correct with his explaination to you. Your job
now is simply to apologize and fade into the shadows.
Jason
SHORT ANSWER: You find it hard because you are used to another way of doing
things. Familiarity leads us down a two-way street where we have the danger
of throwing out the baby with the bath water. Rather than complain how "hard"
something is, take a bit of time to learn the new system
LONG ANSWER:
When you accept the .NET methodology, you find most items are easier to
develop. By the time you get to version 2.0, you find it is even quicker. The
problem is making the paradigm shift from the COM world to the .NET world.
NOTE: Please pardon my sarcasm, but I feel it a bit necessar to make a point.
Let's try this:
If Not (Page.IsValid) Then
'NOTE: Could use window.open() also
Dim s As String = "<script language=JavaScript>" _
+ Chr(13) + Chr(10) + "alert('Dood you forked up');" _
+ Chr(13) + Chr(10) + "</script>"
Dim l As New LiteralControl(s)
Page.Controls.Add(l)
End If
No, that is not complex enough. Other options:
1. Emit Client Side Scripting with RegisterClientSideScript on a control
2. Insert a JavaScript block that checks for a value (set from code behind)
to see if it should pop an alert
Neither of those are very complex either. Perhaps:
3. Add the JavaScript for the popup and then determine whether the body
should load the popup based on a value
Nope! Still not very complex.
There has to be a way of doing this that is complex, but for the life of me,
I cannot figure it out. Oh, wait:
3. Set up a control that uses RenderBeginTag() RenderEndTag() and
AddAttribute() to output the popup JavaScript or not based on the state of
validity. This will force you to compile the server code, add a reference and
set the proper valid property on the control.
Now, that is getting a bit complex. Perhaps this is what you were talking
about? If so, I agree. That is hard!
Now, if you want something that truly is harder, try dinking with XML in
..NET versus XML in ASP/VB COM. But, the changes are necessary to keep to a
true OO methodology.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"zamdrist@.gmail.com" wrote:
> I can't believe the machinations one must go through to get a simple
> messagebox for form validation purposes to work via ASPX & code-behind
> VB.
> What an incredibly stupid omission/oversight on the part of the .Net
> developers.
> We sure got some sexy XML stuff going though! Incredible.
> Marketing over substance. Good job Billy.
>
It is important to note that the .Net Platform is just that - a Platform.
Microsoft never intended that developers would be able to find everything
they could possibly need in writing a web application, and create one
without having to write a single class or method of their own. What
Microsoft intended was to provide a highly-extensible platform of
technologies, and a tool box full of all kinds of tool components which
would enhance productivity by providing a rich set of common functionality,
which could easily be extended and enhanced by developers with different
agendas.
The Common Language Runtime Library is probably the single most extensive
and titanic collection of tools ever developed by a software company for use
by developers. After 4 years of working with it, I haven't used 1/10th of
it, and am just beginning to feel like I know where to find everything I
need. It is a "Library of Congress" full of NameSpaces, classes, interfaces,
enumerations, data types, etc., etc., which I am awed by every time I look
through it.
Still, it only provides low- to medium-level tools for development. This
again was a wise decision by Microsoft, which, of all software companies in
the world, realizes that the world is a big place, full of all kinds of
people and cultures, and an immense variety of business situations and
requirements. The toolbox that Microsoft has provided, while intimidatingly
large, is still small enough to negotiate. The tools are interoperable, and
easily combined to create a custom toolset of situation-specific tools for
use by any Enterprise. The CLR is a productivity extravaganza.
My point is this: Assuming that, for example, a MessageBox class, similar in
functionality to the Windows MessageBox class, but tailored to HTML, is
requested by a large segment of developers, and determined to be common to
many web applications, Microsoft may yet add one to the toolbox. However,
the fact that one does not (yet) exist is no cause for complaint. If I were
given (mind you, the .Net platform and the CLR are FREE) a billion dollars
(far less than it cost Microsoft to develop the CLR), I would not be
ungrateful that I was not given a billion and one dollars instead!
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
in message news:3250E8AC-461D-4007-AA38-261FC3A9413F@.microsoft.com...
> SHORT ANSWER: You find it hard because you are used to another way of
> doing
> things. Familiarity leads us down a two-way street where we have the
> danger
> of throwing out the baby with the bath water. Rather than complain how
> "hard"
> something is, take a bit of time to learn the new system
> LONG ANSWER:
> When you accept the .NET methodology, you find most items are easier to
> develop. By the time you get to version 2.0, you find it is even quicker.
> The
> problem is making the paradigm shift from the COM world to the .NET world.
> NOTE: Please pardon my sarcasm, but I feel it a bit necessar to make a
> point.
> Let's try this:
> If Not (Page.IsValid) Then
> 'NOTE: Could use window.open() also
> Dim s As String = "<script language=JavaScript>" _
> + Chr(13) + Chr(10) + "alert('Dood you forked up');" _
> + Chr(13) + Chr(10) + "</script>"
> Dim l As New LiteralControl(s)
> Page.Controls.Add(l)
> End If
> No, that is not complex enough. Other options:
> 1. Emit Client Side Scripting with RegisterClientSideScript on a control
> 2. Insert a JavaScript block that checks for a value (set from code
> behind)
> to see if it should pop an alert
> Neither of those are very complex either. Perhaps:
> 3. Add the JavaScript for the popup and then determine whether the body
> should load the popup based on a value
> Nope! Still not very complex.
> There has to be a way of doing this that is complex, but for the life of
> me,
> I cannot figure it out. Oh, wait:
> 3. Set up a control that uses RenderBeginTag() RenderEndTag() and
> AddAttribute() to output the popup JavaScript or not based on the state of
> validity. This will force you to compile the server code, add a reference
> and
> set the proper valid property on the control.
> Now, that is getting a bit complex. Perhaps this is what you were talking
> about? If so, I agree. That is hard!
> Now, if you want something that truly is harder, try dinking with XML in
> .NET versus XML in ASP/VB COM. But, the changes are necessary to keep to a
> true OO methodology.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ***************************
> Think Outside the Box!
> ***************************
>
> "zamdrist@.gmail.com" wrote:
>> I can't believe the machinations one must go through to get a simple
>> messagebox for form validation purposes to work via ASPX & code-behind
>> VB.
>>
>> What an incredibly stupid omission/oversight on the part of the .Net
>> developers.
>>
>> We sure got some sexy XML stuff going though! Incredible.
>>
>> Marketing over substance. Good job Billy.
>>
>
Hammers suck*!!! :-)
* Read the thread ".NET SUCKS - READ THE FOLLOWING. MICROSOFT IS A SUCKY
COMPANY" to understand.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Kevin Spencer" wrote:
> It is important to note that the .Net Platform is just that - a Platform.
> Microsoft never intended that developers would be able to find everything
> they could possibly need in writing a web application, and create one
> without having to write a single class or method of their own. What
> Microsoft intended was to provide a highly-extensible platform of
> technologies, and a tool box full of all kinds of tool components which
> would enhance productivity by providing a rich set of common functionality,
> which could easily be extended and enhanced by developers with different
> agendas.
> The Common Language Runtime Library is probably the single most extensive
> and titanic collection of tools ever developed by a software company for use
> by developers. After 4 years of working with it, I haven't used 1/10th of
> it, and am just beginning to feel like I know where to find everything I
> need. It is a "Library of Congress" full of NameSpaces, classes, interfaces,
> enumerations, data types, etc., etc., which I am awed by every time I look
> through it.
> Still, it only provides low- to medium-level tools for development. This
> again was a wise decision by Microsoft, which, of all software companies in
> the world, realizes that the world is a big place, full of all kinds of
> people and cultures, and an immense variety of business situations and
> requirements. The toolbox that Microsoft has provided, while intimidatingly
> large, is still small enough to negotiate. The tools are interoperable, and
> easily combined to create a custom toolset of situation-specific tools for
> use by any Enterprise. The CLR is a productivity extravaganza.
> My point is this: Assuming that, for example, a MessageBox class, similar in
> functionality to the Windows MessageBox class, but tailored to HTML, is
> requested by a large segment of developers, and determined to be common to
> many web applications, Microsoft may yet add one to the toolbox. However,
> the fact that one does not (yet) exist is no cause for complaint. If I were
> given (mind you, the .Net platform and the CLR are FREE) a billion dollars
> (far less than it cost Microsoft to develop the CLR), I would not be
> ungrateful that I was not given a billion and one dollars instead!
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Neither a follower nor a lender be.
> "Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@.comcast.netNoSpamM> wrote
> in message news:3250E8AC-461D-4007-AA38-261FC3A9413F@.microsoft.com...
> > SHORT ANSWER: You find it hard because you are used to another way of
> > doing
> > things. Familiarity leads us down a two-way street where we have the
> > danger
> > of throwing out the baby with the bath water. Rather than complain how
> > "hard"
> > something is, take a bit of time to learn the new system
> > LONG ANSWER:
> > When you accept the .NET methodology, you find most items are easier to
> > develop. By the time you get to version 2.0, you find it is even quicker.
> > The
> > problem is making the paradigm shift from the COM world to the .NET world.
> > NOTE: Please pardon my sarcasm, but I feel it a bit necessar to make a
> > point.
> > Let's try this:
> > If Not (Page.IsValid) Then
> > 'NOTE: Could use window.open() also
> > Dim s As String = "<script language=JavaScript>" _
> > + Chr(13) + Chr(10) + "alert('Dood you forked up');" _
> > + Chr(13) + Chr(10) + "</script>"
> > Dim l As New LiteralControl(s)
> > Page.Controls.Add(l)
> > End If
> > No, that is not complex enough. Other options:
> > 1. Emit Client Side Scripting with RegisterClientSideScript on a control
> > 2. Insert a JavaScript block that checks for a value (set from code
> > behind)
> > to see if it should pop an alert
> > Neither of those are very complex either. Perhaps:
> > 3. Add the JavaScript for the popup and then determine whether the body
> > should load the popup based on a value
> > Nope! Still not very complex.
> > There has to be a way of doing this that is complex, but for the life of
> > me,
> > I cannot figure it out. Oh, wait:
> > 3. Set up a control that uses RenderBeginTag() RenderEndTag() and
> > AddAttribute() to output the popup JavaScript or not based on the state of
> > validity. This will force you to compile the server code, add a reference
> > and
> > set the proper valid property on the control.
> > Now, that is getting a bit complex. Perhaps this is what you were talking
> > about? If so, I agree. That is hard!
> > Now, if you want something that truly is harder, try dinking with XML in
> > .NET versus XML in ASP/VB COM. But, the changes are necessary to keep to a
> > true OO methodology.
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> > ***************************
> > Think Outside the Box!
> > ***************************
> > "zamdrist@.gmail.com" wrote:
> >> I can't believe the machinations one must go through to get a simple
> >> messagebox for form validation purposes to work via ASPX & code-behind
> >> VB.
> >>
> >> What an incredibly stupid omission/oversight on the part of the .Net
> >> developers.
> >>
> >> We sure got some sexy XML stuff going though! Incredible.
> >>
> >> Marketing over substance. Good job Billy.
> >>
> >>
>
>ASP.NET hasn't made anything harder for you. At worst it can only have
>made you lazier.
that is the point.. Since ASP.NET code look like VB, lot of newbies
expect it to work like VB :)
well well well...
"really, really good programmers" don't deal with MS shit anyway hahaha
they actually code their webapps in Java and they run them in their free
Apache-Tomacat or other real application server (no IIS bull-shit).
C++ is a real thing, but I wouldn't really code a webapp in C++, no real
need for that kind of complication.
If some programmer is still stuck in the VB/.NET/C# etc mess he is nothing
but just another Micro-Serfs, actually not "really, really good programmer"
at all, at least not yet, IMHO.
Don't forget MS created C# only to answer in some way to the popularity of
Java, and it still doesn't get even close to the expectations of simplicity
functionality and stability Java offers.
The truth is that people still use MS products just and only because of the
monopoly MS holds, so don't come to me trying to tell me what a "really,
really good programmer" should do in an MS environment, the best and only
good thing he can do is just migrate to something better than Lego hahaha.
gab
"zamdrist@.gmail.com" wrote:
> Well, a really good programmer wouldn't need an IDE.
> A really, really good programmer should only write C++ code using vi.
> Gimme a break.
> Kevin Spencer wrote:
> > Hi Steve,
> > > I do think it's quite pathetic there is no practical means to perform
> > > this very routine event (pop-up message box).
> > It certainly is routine. However, don't you think it's quite pathetic that,
> > rather than creating your own function to do something like this, you
> > complain because Microsoft hasn't? A good programmer can write his own
> > tools. But never mind that; here's one of mine:
>
just go Java and leave the MS monopoly alone
give ME a break
"zamdrist@.gmail.com" wrote:
> Well, a really good programmer wouldn't need an IDE.
> A really, really good programmer should only write C++ code using vi.
> Gimme a break.
> Kevin Spencer wrote:
> > Hi Steve,
> > > I do think it's quite pathetic there is no practical means to perform
> > > this very routine event (pop-up message box).
> > It certainly is routine. However, don't you think it's quite pathetic that,
> > rather than creating your own function to do something like this, you
> > complain because Microsoft hasn't? A good programmer can write his own
> > tools. But never mind that; here's one of mine:
>
Actually, I think good UI practices would dictate that you NOT use this
method of validation.
Consider this: You have 20 fields on a web form that have errors. If you use
a custom validator with JavaScript alert as described above, the end user
will have to dismiss 20 alert boxes.
"zamdrist@.gmail.com" wrote:
> Well, a really good programmer wouldn't need an IDE.
> A really, really good programmer should only write C++ code using vi.
> Gimme a break.
> Kevin Spencer wrote:
> > Hi Steve,
> > > I do think it's quite pathetic there is no practical means to perform
> > > this very routine event (pop-up message box).
> > It certainly is routine. However, don't you think it's quite pathetic that,
> > rather than creating your own function to do something like this, you
> > complain because Microsoft hasn't? A good programmer can write his own
> > tools. But never mind that; here's one of mine:
>
0 comments:
Post a Comment