tgreer 189 Made Her Cry Team Colleague

When the page in the right-frame loads, it should disable the buttons in the left-frame, until it is done computing. When it is done, it should enable the buttons.

tgreer 189 Made Her Cry Team Colleague

Because I saw no JavaScript in his code. I saw PHP code that produces JavaScript. So the first step in troubleshooting the problem is to make sure all of the PHP is valid. If it is, then we can move on to working through the JavaScript.

If a user truly wants help with JavaScript, they should post the relevant JavaScript. With server-side-generated code, the best way to see what is actually produced is to "view source" and copy the relevant code snippets to the forum. Which the original poster can still do! He hasn't been "banned" from the JavaScript forum by any means. I just made a judgment call that he would get better help here.

While we're talking about clarity, in a technical forum I would recommend proper spelling and punctuation. :)

tgreer 189 Made Her Cry Team Colleague

You seem to be asking someone to troubleshoot your PHP code. So, I've moved this thread to the PHP forum.

If you're asking a JavaScript question, post only the JavaScript code that appears to contain the problem.

tgreer 189 Made Her Cry Team Colleague

Another technique I've used in the past is to include a script that fires "onsubmit". You have to add an onsubmit handler to your form.

That script makes a div or image or window, whatever, visible. That newly visible element will be your "please wait" message. Then, return "true" so that the form submits.

tgreer 189 Made Her Cry Team Colleague

Why not simply remove the time delay? I'm sure I'm missing something here!

Set the initial src of your right frame to a static page that does two things:

1) Display a "Please wait" message.
2) Submit a request to the datagrid page (use a form with action tag set to the .aspx page).

The Please Wait message will display until the datagrid page returns.

tgreer 189 Made Her Cry Team Colleague

Did that answer your question? Any feedback?

tgreer 189 Made Her Cry Team Colleague

The article I linked to explains all of that, complete with sample code and a detailed explanation of the ASP.NET Page Life Cycle.

In short, though, you have to overload the LoadViewState method.

ASP.NET has a "Load" method, ok? And it automatically allows you to overload it by giving you a Page_Load method to code.

You also can see the Initialization method, but Visual Studio warns you not to edit it.

What you don't see are the other methods that are called automatically, which include LoadViewState and LoadPostBackData.

By default, most new users create their controls in Page_Load, because they think that's what happens FIRST. That's not correct. Initialization happens first. Then LoadViewState, then LoadPostBack, then comes the Load.

So you can create your controls during Initialization (which is what Visual Studio does), or you can overload LoadViewState, like so:

protected override void LoadViewState(object savedState)
{
	base.LoadViewState(savedState);
        // your code here
}
tgreer 189 Made Her Cry Team Colleague

This is tricky. I'm guessing (and it's a guess because ASP.NET is not built to handle dynamic controls, and weird things happen), that you're a victim of the ASP.NET Page Lifecycle.

You're creating the controls on Page_Load, which is good, because dynamic controls must be recreated every time. However, by the time they are created, the LoadPostBack stage has already occured.

In order to make this work, you have to recreate your controls prior to the Load stage.

This article ASP.NET Page Life Cycle and Dynamic Controls discusses the topic in-depth.

Basically, you need to overload the LoadViewState method, and recreate your controls there. Then, when LoadPostBack occurs, your controls will be there to receive their values.

tgreer 189 Made Her Cry Team Colleague

This probably isn't the correct forum for your question, since you aren't really asking a programming question.

But I'll briefly mention that while the client-side interface definitely uses JavaScript and CSS (the same is true of ANY sophisticated system), there is a lot of server-code that generates the overall functionality of Yahoo News.

You aren't going to find a complete turnkey solution for "free".

tgreer 189 Made Her Cry Team Colleague

Give each location a unique login name. It's as simple as that. The database itself should take care of any record locking issues. As this isn't an ASP.NET issue, if you have further questions they should be posted in the Database section.

tgreer 189 Made Her Cry Team Colleague

Use double quotes around your string:

"this is hm's program"
tgreer 189 Made Her Cry Team Colleague

Yes, ASP.NET is a dual-edged sword when it comes to browser capabilities. Your solution is the right one. However...

<rant>
A professional web developer knows about cross-browser issues, and doesn't need a runtime dll on the web server to try to FIX THINGS FOR HIM (or HER)!

I prefer to write strict XHTML. I prefer to have external style sheets. If I want a DIV, I'll use a DIV. If I want a TABLE, I'll write a TABLE. What I don't need is a mysterious "panel" control that will render a div or a table based on it's own misunderstandings of what browsers are capable of what.

That being said, when I do ASP.NET development, I use the bare minimum of ASP.NET Web Server controls. If I want a DIV, I use a pure HTML DIV.
</rant>

tgreer 189 Made Her Cry Team Colleague

Ok, this is very rudimentary, but consider this page:

<html>
<head>
<script type="text/javascript">
function parseState()
{
  var q = unescape(location.search);
  q = q.substring(7, q.length);
  if (q != "")
  {
    document.getElementById("state").options.selectedIndex = q;
  }
}
</script>
</head>
<body onload="parseState();">
<form>
<select id="state">
<option value="" selected="selected">Select a State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
</form>
</body>
</html>

If this page was named "pickstate.html", and you loaded it with the querystring:

pickstate.html?state=1

Then, "Alaska" would be selected in the SELECT element.

Why do I say it's rudimentary? For one, the querystring parser isn't robust. Ideally, you'd parse the entire querystring into a JavaScript array, so you could pass in multiple values. Not important in your scenario. Also, it relies on "?state=" having seven characters, intead of finding the value by searching for the equal sign.

Next, the index has …

tgreer 189 Made Her Cry Team Colleague

I would append a querystring, containing the value of the previously selected state. Then, author an onload script that checked for the querystring value, and make that the selected option in the select list. If there is no querystring (ie/ first time the page loads), then select some default state.

tgreer 189 Made Her Cry Team Colleague

Just another vote for PHP, against CGI.

CGI was the FIRST web development methodology (it's at this point that someone usually chimes in with a reference to some OTHER methodology which was actually first, but that no one ever used:) )

CGI uses environment variables to pass values. Remember those? Remember doing "PATH=c:\;c:\dos;" in your autoexec.bat files? That's an environment variable. CGI uses stdin and stdout to pass request and response streams. Don't know what those are? Good - that means you're not an old fart like me.

In other words, CGI is ancient and seriously confined in its abilities, including its ability to grow.

PHP is the current king of web development. It surpassed ASP, primarily because Microsoft dumped ASP in favor of ASP.NET. ASP.NET is the worst idea in web development ever. I know, I'm an expert :) ASP.NET is a web development language that pretends it isn't doing web development. Which makes doing web development, of course, a considerable challenge.

tgreer 189 Made Her Cry Team Colleague

For an eye-opening experience with CSS, browse to http://www.csszengarden.com

tgreer 189 Made Her Cry Team Colleague

If you're going to add styles "piecemeal", then yes, you have to use the Styles.Add method. My suggestion was to make complete CSS class definitions, then assign an entire "class" to your control.

No, you cannot have variables in CSS.

"Grid Layout" simply means "CSS absolute positioning". It's another case of Microsoft giving their own term for something that already existed, to presumably obscure the fact that they didn't invent it.

If you absolutely position everything, then when the user resizes their browser, nothing "moves". Most users expects things to "fit" their browser. Flow layout (CSS relative positioning", allows for elements to flow, within constraints, to fit the size of the browser.

tgreer 189 Made Her Cry Team Colleague

You can use CSS with .NET. However, .NET will PRODUCE CSS for IE, not cross-browser CSS.

That's why it's best to code your OWN CSS, and then add class defiinitions via the Add() method of the Attributes collection of the particular server control.

In others words, "styles" are yet one more area where ASP.NET has screwed things up royally.

Always use "flow layout", always create your own internal or external stylesheet, and assign classes to server controls:

myControl.Attributes.Add("class","myCssClass");
tgreer 189 Made Her Cry Team Colleague

There is no way to do this. Print orientation is something the USER specifies, via their print dialog box. You cannot and should not want to control this. The answer is to specify a print style sheet that formats the document in such a way that landscape orientation is not required.

This falls into the same category of developers wanting to "disable" the user's Back button. That's a no-no. That's part of the USER interface. The proper way to handle the situation is to assume they MIGHT press BACK, and write code to handle that eventuality.

You cannot FIX a problem by BREAKING user functionality.

tgreer 189 Made Her Cry Team Colleague

Seems like we're down to just stabbing in the dark, but what would happen if you renamed your .html files to .aspx?

tgreer 189 Made Her Cry Team Colleague

You can also set the "multiline" property of the standard TextBox control. That control will either render an <input> element or a <textarea> element, depending on the properties you set.

tgreer 189 Made Her Cry Team Colleague

Try this screenshot:

[IMG]http://www.tgreer.com/daniweb/IIS-html.gif[/IMG]

1) start IIS Admin, from your Adminstrative Tools start menu.

2) highlight Default Web Site (or the appropriate website), click Properties button on the menu

3) click the Home Directory tab.

4) click the "configuration" button

5) click "Add" button

6) In the "Executable", enter the same value that the ".aspx" value has, which will be an instance of the "aspnet_isapi.dll".

7) in the "Extension", type ".html".

9) click "OK, and so on to save your changes and close the IIS admin tool.

That should force HTML files to be processed via ASP.NET, and hopefully then participate in ASP.NET security.

tgreer 189 Made Her Cry Team Colleague

Use a function. Set the onChange() handler to run this function.

Call the same function at the conclusion of your "popup" script.

tgreer 189 Made Her Cry Team Colleague

Since vBulletin is written in PHP, I've moved this thread to the PHP Forum.

tgreer 189 Made Her Cry Team Colleague

I think they have to be part of the project. I admit that's just a guess. Perhaps someone else can chime in on this thread and confirm that. But since ASP.NET applications are compiled, that's my guess... that any HTML files added to the project are "compiled into" the application, and thus partake in its security.

tgreer 189 Made Her Cry Team Colleague

You're welcome!

tgreer 189 Made Her Cry Team Colleague

Are those HTML files added to your ASP.NET Project? Or are they just "out there" on the server?

tgreer 189 Made Her Cry Team Colleague

Please post ASP.NET questions in the ASP.NET forum.

You use the "FindControl()" method to locate dynamic controls. I'm not going to read 100 lines of code, so if that doesn't help you, then please post a more specific question, with only that section of code which you think is relevant to the question.

tgreer 189 Made Her Cry Team Colleague

You must be joking!

Please narrow your post down to

1) a specific question and
2) only that code which you suspect is the problem!

tgreer 189 Made Her Cry Team Colleague

Fix your "path". Compare what I posted to what you posted!

tgreer 189 Made Her Cry Team Colleague

"Top" is the top-level window object in the hierarchy. Think of it as your "frameset" page.

So "top" contains all of your frames. You're saying, "go to the top window object, look into all the frames it contains, find the one named 'mainFrame', and set that frame's location to the URL 'www.tgreer.com'.

tgreer 189 Made Her Cry Team Colleague

Then ask that in another thread, or forum. You don't need databinding to accomplish that task (nor do you even need ASP.NET or any server-side code).

tgreer 189 Made Her Cry Team Colleague

Try writing a dynamic imaging website. Something that will create, for examples, jpegs or gif files based on user input. I've done such a site, to create bar charts based on values a user entered. It was fun.

tgreer 189 Made Her Cry Team Colleague

If "sales.htm" is in the same folder as the web.config file, authentication will be automatic. If a user tries to browse that specific page, ASP.NET first checks the web.config file to see if anonymous browsing is allowed. If it isn't, it looks for instructions on how to authenticate. It finds them in the <forms> node, and redirects the user to login.aspx. The login.aspx page authenticates the user, and then redirects them to their original page, in this case, sales.htm.

Nothing special needs to go on the sales.htm page.

If you've set all this up and it isn't working, then you haven't set it all up correctly!

tgreer 189 Made Her Cry Team Colleague

Please wrap your code in code tags. Please start a new thread, rather than posting your question as a reply to a resolved thread.

With ASP.NET, it's best practice to separate your pages into an "HTML" template, and a code-behind file.

tgreer 189 Made Her Cry Team Colleague

Modify your window.location statement in your track() procedure to reference a specific frame, rather than the entire "window":

top.frames["mainFrame"].location.href="www.tgreer.com";
tgreer 189 Made Her Cry Team Colleague

Please look at the following web.config file:

<configuration>
  <system.web>
    <authentication mode="Forms">
      <forms name=".MYCOOKIE" 
             loginUrl="login.aspx" 
             protection="All" 
             timeout="30" 
             path="/"/> 
    </authentication>
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>
</configuration>

The properties/attributes of the "forms" element control your authentication cookie. The "name" specifies the name of the cookie. "protection" is how your cookie will be protected. "All" means it will be validated and encrypted. "Timeout" controls when your cookie will expire, in minutes.

Notice also the "loginurl" property. It points to "login.aspx" in this sample. This is the page YOU MUST WRITE.

In the "authorization" section, you can see we're denying access to all anonymous users. This means no matter which page they link to, if they're not authenticated, they'll be redirected to the login.aspx.

What should your login.aspx page do? Prompt for username and password, obviously. You can compare the values the user enters to something you've hardcoded, or you can look the values up in the database, whatever you like!

Once you've determined, through whatever mechanism you care to code, that the username and password are valid, you have to let the authentication mechanism know they are a valid, authenticated user.

You do this by using the FormsAuthentication class in the code-behind of your login.aspx page.

There are a number of methods & properties, including .Authenticate, and .RedirectFromLogin.

You can also store your usernames and passwords within the web.config file itself, by adding a "credentials" node:

<credentials passwordFormat="Clear">
          <user name="user1" password="password1"/>
          <user name="user2" password="password2"/>
          <user name="user3" …
tgreer 189 Made Her Cry Team Colleague

I would suggest using a database to store the dynamic content, and then use standard web development techniques for querying a database for content.

Or, use a tool like SnippetEdit http://www.SnippetEdit.com, which allows users to directly edit their content.

tgreer 189 Made Her Cry Team Colleague

I too am a bit confused by the question. If you want your page to be DYNAMIC, you can add WebServer controls, and set their properties, at runtime. Doing so can be very problematic. This article details some of the issues and workarounds:

ASP.NET Page Life Cycle and Dynamic Controls

The page in your example certainly wouldn't require any ASP.NET, why not just create a simple HTML page?

Also, do you need a server round-trip for this? JavaScript can write into an open window.

I think we need more details about what it is you're attempting before we can give meaningful answers. Please post a more specific follow-up question.

tgreer 189 Made Her Cry Team Colleague

You cannot direclty read a file on another server. You can browser to it, though. What you need to do is called "screen scraping", I think. You might start a thread or do some Google searches on that topic.

tgreer 189 Made Her Cry Team Colleague

Thanks. We'll need to see your stripped-down frameset code, so we can see how many frames you have, their relationship to each other, the IDs you've given them, and so on.

tgreer 189 Made Her Cry Team Colleague

ASP.NET is nothing like ASP. They are wildly different, completely alien from each other. Both are web development languages, so one can develop similar applications. But the methodology, concepts, are extremely different. ASP.NET is completely OOP, and is compiled, rather than interpreted. The list goes on and on. The next natural successor to ASP is probably PHP.

ASP.NET is an odd offshoot that only exists because Microsoft says it does.

tgreer 189 Made Her Cry Team Colleague

I'm not sure where the concept of "bottom" fits within the frame hierarchy. But you can refer to specific frames using an indexer of the frame collection:

frames[1], frames[2], and so on.

Also look at the "top" and "parent" objects, and possible the "this" keyword, the "self" object, and so on. Seeing some code would help us help you.

tgreer 189 Made Her Cry Team Colleague

Well, in that case, yes... RegisterStartupScript is ONE WAY to insert a script into the response stream. The script will execute as soon as the browser interprets it, because it isn't placed into the document HEAD nor as part of a function definition. The main point here is that the user's browser executes the script. Your ASP.NET code just puts the script on the page.

There are other ways to assign scripts to certain client-side events. The technique I like to use is to call the "Attributes.Add()" method of specific server controls.

tgreer 189 Made Her Cry Team Colleague

Repeat this to yourself 17 times in a row:

1. ASP.NET is Server side.
2. JavaScript is Client side.


JavaScript cannot execute on the server. Page.RegisterStartupScript() is extremely simplistic. All it does is add whatever is in your second parameter, as text, to the bottom of the response stream. So it's serving your page, right? And the last thing it puts on the page, is the string in RegisterStartupScript.

If that string is in the form "<script>alert('Hello');</script>", then what will happen? When that page loads in the users browser, that script will run, and "Hello" will popup. The script ran ON THE CLIENT. However, that script was put onto the page, via ASP.NET.

What does this have to do with PostBack? Absolutely nothing at all.

Now, go back and read those first two points aloud 17 more times. :)

And for further reading on the topic:
Integrating client-side scripts with ASP.NET.

tgreer 189 Made Her Cry Team Colleague

You misunderstand ASP.NET Forms Authentication. It will handle all of this for you, automatically. You set it so that it authenticates the entire site, or particular directories. You don't have to write any JavaScript at all. If someone navigates to a page, ASP.NET will check to see if they are authenticated or not. If not, they are directed to your login page. Do a Google search of "ASP.NET Forms Authentication", and research it thoroughly.

tgreer 189 Made Her Cry Team Colleague

I don't understand the need for JavaScript here. ASP.NET Forms authentication handles it all for you, including managing the cookies.

tgreer 189 Made Her Cry Team Colleague

I'm not sure about the exact nature of the problem, here.

First, stop using FrontPage! Learn to write HTML, CSS, and JavaScript "by hand".

Second, realize that you can put standard HTML into an aspx (ASP.NET WebForm). You don't HAVE to use an ASP.NET Web Control.

If you want an ASP.NET page to contain a hyperlink to a standard web page, then just include a standard hyperlink!

<a href="myStandardPage.html">Link to my non-asp.net page</a>

If you want a standard HTML page to link to an ASP.NET page, it's the same thing.

<a href="myASPNETpage.aspx">Link to my ASP.NET page</a>

If I haven't answered your question, try asking it again, and be very, very specific.

Paladine commented: Bravo! +4
tgreer 189 Made Her Cry Team Colleague

It probably doesn't work on Page Load, because you have no hidden variable until you click the button. Without seeing your code, I can't be sure.

But always realize, that the controls on the page, manipulated in the browser, using JavaScript, don't automatically correspond to ASP.NET server-side web controls.

It only appears that way! If you drag a textbox onto a form in Visual Studio, you are creating a "TextBox" Server control. When the ASP.NET code runs, that control CREATES or RENDERS an HTML <input> element. They are two separate things.

When you postback the page, IIS/ASP.NET RECREATEs the TextBox control, every time, and then digs back through the HTTP headers to find the <input> element and synch the two back together.

That's all wonderful, until you try to do any standard JavaScript control manipulation, such as dyamically creating hidden elements or setting values. It's like ruining a magician's beautiful card trick by shuffling the deck before giving it back to him.

Two other approaches for you to consider:

1) Set your own ViewState variables. ViewState.Add(). Server-side, set or get the value of your viewstate variable, and based on that value, Register a Script (Page.RegisterStartupScript) that contains your JavaScript. In other words, dynamically create your JavaScripts, server-side, that will run once the page is served back to the user.

2) Use Session variables.

Thanks for the words of appreciation.

tgreer 189 Made Her Cry Team Colleague

I would encourage anyone else curious about this to contact Google directly. The answer I got from their Adsense technical support department is quite different.