tgreer 189 Made Her Cry Team Colleague

There are quite a few examples. If you do an internet search for "CSS fluid layout template", you should find everything you need.

tgreer 189 Made Her Cry Team Colleague

A software vendor has expressed interest in sponsoring my site. They asked me to author a marketing proposal.

Basically, I would run their banner in selected spots, as well as let them send out mailings to my site members who have opted-in.

This in exchange for a set montly fee and a minimum commitment of 6 months.

Has anyone else written such a proposal? How formal do they need to be?

tgreer 189 Made Her Cry Team Colleague

It's part of the System.IO namespace.

tgreer 189 Made Her Cry Team Colleague

If I understand your situation, you want to write an ASP.NET application that will produce a set of static HTML pages, which you can then upload to a separate site.

To produce HTML files (or any other files), you would use the StreamWriter class or one of its overloads (TextWriter).

tgreer 189 Made Her Cry Team Colleague

Hmm. Hard to answer without seeing the code and pages. My guess, and it's just a guess, is that CSS is positioning the various elements, so digging though the code-behind pages won't help you.

tgreer 189 Made Her Cry Team Colleague

I would suggest using a control that supports custom paging, but that wouldn't help in your environment.

I would have a loop, reading your products out of a database. Write pure HTML out to a file. Use a counter, when your loop iterates through a given number of products, close the current HTML file, and open a new one. Your one loop will generate any number of HTML files.

tgreer 189 Made Her Cry Team Colleague

On a large system I helped develop, we had this issue. Customers could order various products for print, and see a real-time PDF of the customized product before they ordered. Each product could have a custom form, and each form element could have custom validation. We didn't find any shortcuts! Sometimes coding is hard work.

Everything was database driven, and the site was written in classic ASP. We had a database table full of JavaScript validation routines we'd built-up over time. When the server script ran, it would make the appropriate event-handler assignments to the proper tags. We would dynamically author a single "validate" routine, and each object that required validation would call this function, passing itself in as a parameter. Based on the parameter/object, it would call the appropration clause in the routine to validate itself.

tgreer 189 Made Her Cry Team Colleague

I think you'll need some server side code. Something that looks at a timestamp, a rolling counter, a database value, something... and automatically authors the appropriate image tag. Right now, I can't think of how you'd accomplish this with client scripting.

tgreer 189 Made Her Cry Team Colleague

It's going to be difficult to help you with a coding issue if you don't write code!

Part of the issue is determining what, exactly, you want to "hover over". If you want to hover over an image or a hyperlink, then the basic is to supply the "alt" attribute. Modern browsers will automatically convert the text into the basic, default "tip".

Anything else will require DHTML knowledge.

tgreer 189 Made Her Cry Team Colleague

Or, the "web" domain can simply connect to the database on the other server. Nothing fancy, just a basic connection string.

tgreer 189 Made Her Cry Team Colleague

That's a very bad idea. A user could craft any statement they like? They could wipe out the entire database.

Your question is a bit too general to give a meaningful answer. Give them a textarea, and pass in what they type as the value of the CommandText property.

tgreer 189 Made Her Cry Team Colleague

Use the "border=0" property.

tgreer 189 Made Her Cry Team Colleague

www.w3.org.

They have validators and badges you can post on your site.

tgreer 189 Made Her Cry Team Colleague

Oh. Yep, you use .ExecuteNonQuery().

tgreer 189 Made Her Cry Team Colleague

You're asking for a lot. You collect your form data from the properties of the various server controls. The syntax for SQL is the same regardless of the underlying database, more or less. MySQL is a good server-side database program.

If you are completely new to data-drive web development, then you need to break things down into discrete steps.

1) Connect to a database, retrieve information, display it on a page. That will teach you how to interact with your database.

2) Build a form with server controls. When the user submits a form, gather the information and post it back to the user. That will teach you how to gather form data.

3) Put it all together.

tgreer 189 Made Her Cry Team Colleague

Hold the presses!

Have you seen this site?

http://codepunk.hardwar.org.uk/ajs02.htm

It does exactly what I was describing. Plus, it's presented in a step by step tutorial fashion.

tgreer 189 Made Her Cry Team Colleague

I see... no, I don't know of any pre-existing code you could glean. But then, I haven't looked.

I could write you something, but I'm currently involved in a lot of "for pay" work, and don't have much time.

Why not just give it a try yourself? Everyone here would be glad to help you along.

tgreer 189 Made Her Cry Team Colleague

RichTextBox is in the .NET Framework, but only for Windows Forms, not for Web Forms. This is because ASP.NET renders HTML, and HTML doesn't contain a RichText element.

So your answer will be to buy a 3rd party control that will likely render as an ActiveX object.

tgreer 189 Made Her Cry Team Colleague

Scrolling is tough... break this into steps. The first step is to write a "scrollDetector", a function that will report the positions, horizontal and vertical, that a user has scrolled.

IE and Moz browsers both store this value, but they use different JavaScript properties (the underlying DOM is different).

Once you can store the pixel values of the scroll, you can use them to position your image (or better yet, the <div> which contains your image).

For IE, use:

document.body.scrollTop

which is the number of pixels FROM the top the user has scrolled. How far right have they scrolled? document.body.scrollLeft

if the scrollbars don't exist on a particular page, the value returned will be zero.

Moz/Netscape/FireFox browsers use "window.pageYOffset" and "window.pageXOffset".

So you have to write 1) browser detection code and then 2) a function that will report pixels scrolled.

The next problem is, how/when do you call this function? Browsers may or may not have a "scroll" event, which may or may not fire on all elements, or may or may not fire if the scroll was done with the mousewheel vs. keyboard, etc. It's nasty.

So, I would use the setInterval() function. Call your scroll detector every so many milliseconds. Note the pixels scrolled, and use them to adjust your image position.

Lastly, load your setInterval() function in the body onload event.

It's a lot to put together, but it's straightforward coding.

Holler if you …

tgreer 189 Made Her Cry Team Colleague

You're welcome. Ain't forums grand?

tgreer 189 Made Her Cry Team Colleague

Here's a site (blog site) that has what I think is a nice "neutral" color scheme:

http://www.stopdesign.com/log/2004/09/03/liquid-bleach.html

Dani - don't stress too much about colors. As long as the site is readable (which it is), then you're ok.

tgreer 189 Made Her Cry Team Colleague

Yeah, I can tell. The overall affect as one traverses the site, though, is a bit too "precious" for my tastes.

But it isn't about me. If your goal was to create a tech site that didn't conform to the Microsoft-induced "tech" color scheme, you did it. Also, if you wanted, consciously or not, to underscore the site is operated by a "girl", you did that too!

I'll just to balance my time here with visits to some manly site.

tgreer 189 Made Her Cry Team Colleague

Dare I say it. I like the layout. I'm not a big fan of the color scheme. I'm typing this reply in a 3-toned pastel purple box. I have the faint taste of grape Bubblicious bubblegum in my mouth. I have the urge to draw a unicorn, and change all the dots above my "i"s into bubbly heart shapes.

tgreer 189 Made Her Cry Team Colleague

I have a thorough article on my site dealing with the thorny topic of dynamic controls:

http://www.tgreer.com/aspnet_html_04.html

Let me know if it helps.

tgreer 189 Made Her Cry Team Colleague

What does the rendered table need to do?

If the answer is "it needs to contain "stuff" that the user will click/change, and then more server code will run", then you need to "Render dynamic controls", and should use a server side control to do that. Repeater. DataList. DataGrid.

If the answer is "sit there and look pretty", then you simply output a good old fashioned HTML Table, by using the LiteralControl.

The idea is: drag a PlaceHolder where you want the table to be.

Build a query, run the query, return a SqlDataReader.

Start your table:

PlaceHolder1.Controls.Add(new LiteralControl("<table>"));

Read through your datareader, outputting tags and content as you go:

while(myDataReader.Read())
{
  PlaceHolder1.Controls.Add(new LiteralControl("<tr><td>" + myDataReader["myField"].ToString() + "</td></tr>"));
}

And so on.

tgreer 189 Made Her Cry Team Colleague

The code I posted is the first step. It will watch for the mouse movement, and then fire a JavaScript function when the mouse moves, passing in the coordinates.

Someone will have to write the function to take those coordinates and use them to move your image.

I don't know if there are any pre-built scripts out there, which is what you want.

But the coding itself should be straightforward for a JavaScript programmer.

tgreer 189 Made Her Cry Team Colleague

I'm having difficulty understanding the question. What attempts have you made so far to write this script?

If you want to capture the mouse movement and have it fire a JavaScript function, you'll have to use browser-specific code:

// id browsers
var iex=(document.all);
var nav=(document.layers);
var old=(navigator.appName=="Netscape" && !document.layers && !document.getElementById);
var n_6=(window.sidebar);

// capture mouse pointer
if(nav)document.captureEvents(Event.MOUSEMOVE);
if(n_6) document.addEventListener("mousemove",get_mouse,true);
if(nav||iex)document.onmousemove=get_mouse;

Then your "get_mouse" function would perform whatever sliding or navigation event you want, based upon the mouse coordinates captured in the "event" object.

tgreer 189 Made Her Cry Team Colleague

With JavaScript? You have to build a querystring.

tgreer 189 Made Her Cry Team Colleague

This little problem made me delve deeply into the issues. The results of my investigation:

http://www.tgreer.com/aspnet_html_04.html

tgreer 189 Made Her Cry Team Colleague

You need to empty the current selection range.

function addtb()
{
  document.selection.empty();
  document.getElementById("TextEditor").focus();
  cmd = 'InsertInputText';
  document.getElementById('TextEditor').document.execCommand(cmd,'true');

  var TE = document.getElementById('TextEditor');
  var TEcn=TE.children;

  for (i=0;i<TEcn.length;i++)
  {
    n++;
    if(TEcn[i].id == "")
    TEcn[i].id = "tb" + n;
  }

}
belama commented: Thanks, I seached long for this but for some reason, I did not find it. :) +1
tgreer 189 Made Her Cry Team Colleague

I think you're in over your head. I don't say that to be mean, just to be realistic. Writing a page that performs calculations, validations, and produces a static document (PDF) for saving a "hardcopy", plus email responses, is straightforward for a programmer. It is emphatically NOT easy for a non-programmer.

Hire someone.

tgreer 189 Made Her Cry Team Colleague

In your above code snippet, you're building a string called "winprops" that is used in the window.open() command.

That string is built from hard-coded strings and variables that are passed into the function.

When you call the NewWindow() function, you pass in the values:

NewWindow("www.tgreer.com","500","400","no")

would create a new window, 500x400, with no scrollbars, containing my website as content.

If you want it to NOT be resizable, you need to change the winprops string to:

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'

I would recommend you not do this. When you take away the ability for a user to do something they expect to be able to do (such as resize a window), it creates a "negative user experience".

tgreer 189 Made Her Cry Team Colleague

The <% %> brackets indicate ASP. Your host must support ASP processing for this code to run.

tgreer 189 Made Her Cry Team Colleague

As another idea, look at the DOM properties for "screen.width" and "screen.height". Based upon those, you could use JavaScript to change the size of your window. The content should be structured either to resize automatically (use percentages, floats, etc. for your elements' size and position), or to stay centered.

tgreer 189 Made Her Cry Team Colleague

It is late and I am a little tired so reading code is getting hard at this hour.... but why not store this variable value in a Session variable?

The ViewState mechanism is much better, for my purposes. I don't need the value to persist through the entire Session.

The real question is, why doesn't it persist through the Viewstate automatically?

If you create a dynamic textbox, conditionally, say in response to some other control's click event. Then, on PostBack, you recreate a "new" TextBox with the same object name, then "magically" that new textbox becomes the dynamically-created textbox. You get all of the user-initiated and code-generated properties.

What I've discovered is that, at least with ListButtons, is that the CommandArgument property doesn't act this way.

tgreer 189 Made Her Cry Team Colleague

That's what I get for reading posts too quickly. For some reason I had in mind the OP was asking if JavaScript could tell if the page was sent in response to a POST or GET header.

If you simply want to check the URL, then yes, your technique should work.

tgreer 189 Made Her Cry Team Colleague

To my knowledge, you can't use JavaScript for this. JavaScript has a limited set of core operators, statements, and objects.

In this case, I would think the Document object would be the relevant one. I don't see any method or property of the browser DOM that returns header information (besides the "mimeType" property).

If I'm wrong, someone please correct me. I think you'll need a server-side language for this.

tgreer 189 Made Her Cry Team Colleague

I'm having a problem with a dynamic LinkButton.

For a result returned from a database query, I create two LinkButtons, dynamically. One is "Update" and the other is "Delete".

I store Update or Delete in the .CommandName property. I store the identity value (the primary key) of the database record in the .CommandArgument property.

All of this is in a method that is called when a user clicks a particular record displayed from a previous operation. Still with me?

public void createUpDelPaper(int xPaperID, string xPaperTitle)
{

PlaceHolder1.Controls.Add(new LiteralControl("<fieldset>"));
PlaceHolder1.Controls.Add(new LiteralControl("<legend>Update/Delete Paper</legend>"));
PlaceHolder1.Controls.Add(new LiteralControl("<label for='title'>Title:</label>"));

txtNewPaper = new TextBox();
txtNewPaper.Columns = 45;
txtNewPaper.ID = "title";
txtNewPaper.CssClass = "input-box";
txtNewPaper.Text = xPaperTitle;
txtNewPaper.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine;
txtNewPaper.Attributes.Add("onkeypress","enterSubmit(this,event)");
PlaceHolder1.Controls.Add(txtNewPaper);

lnkAddPaper = new LinkButton();
lnkAddPaper.CommandName = "UpdatePaper";
lnkAddPaper.CssClass = "submit-button";
lnkAddPaper.Text = "Update";
lnkAddPaper.ID = "Update";
lnkAddPaper.Command += new System.Web.UI.WebControls.CommandEventHandler(paperTitle_Click);
PlaceHolder1.Controls.Add(lnkAddPaper);

lnkAddPaper = new LinkButton();
lnkAddPaper.CommandName = "DeletePaper";
lnkAddPaper.CssClass = "submit-button";
lnkAddPaper.Text = "Delete";
lnkAddPaper.ID = "Delete";
lnkAddPaper.Command += new System.Web.UI.WebControls.CommandEventHandler(paperTitle_Click);
PlaceHolder1.Controls.Add(lnkAddPaper);

PlaceHolder1.Controls.Add(new LiteralControl("</fieldset>"));
ViewState.Add("ManagePapers","2");
}

Now, I do know about dynamic controls. The next time the page loads, these controls have to be recreated, and then the ViewState mechanism ties these "new" controls to their delegates for event processing.

All well and good. But when I recreate these controls, I cannot recreate the .CommandArgument. It's a chicken-and-egg thing. I store the primary key value in the .CommandArgument so that I know which record to update or delete. But the value of .CommandArgument is set conditionally, and that condition doesn't exist …

tgreer 189 Made Her Cry Team Colleague

I would not suggest a career in programming. I'm a programmer, and have seen the field dramatically polarize. Either you'll need to be a PHD working at Microsoft, or a low-wage employee working at a giant outsourcing company.

For someone in the middle, like me, the field is shrinking and shrinking, and wages are dropping dramatically.

Programming in the "developed" world is fast becoming a cottage industry, with small groups (1 or 2 people) providing custom solutions for small to mid-size private companies.

If I were starting over today, I'd look at networking (routers, servers, cabling), since that is fast growing and will transition to optical soon.

On the other hand, small town, local "computer handy-man" has a market: someone who can install a new DVD drive, show you how to use eBay, and remove all the spyware you dumped on your system.

I wish you well.

tgreer 189 Made Her Cry Team Colleague

You can either define a third function, which would have the sole purpose of calling the other two functions.

Or, you can comma separate the two functions in your onload attribute.

Or, you can concantenate them with the "&&" operator:

<body onload="return (Do_This() && Do_That())" >

(which is a useful construct if the functions return booleans).

Lastly, you can just include the "And_This()" function in a separate script body at the very end of your document. It will run "inline" when the browser encounters it.

tgreer 189 Made Her Cry Team Colleague

Are you asking a question, or advertising something?

tgreer 189 Made Her Cry Team Colleague

http://webreference.com/programming/javascript/professional/chap21/2/5.html

If you view the source on that frame, you'll find the code and the above reference.

tgreer 189 Made Her Cry Team Colleague

I think I need to see your "ASP Array".

tgreer 189 Made Her Cry Team Colleague

You need to replace the line carriage characters with <br/> tags.

tgreer 189 Made Her Cry Team Colleague

Sorry. Welcome to the world of the browser. The user is God of this world. Meaning, that you can't script an automated print. That would be "hijacking" control away from the user. The JavaScript "print" method sends a request to the browser. The browser responds by opening the Print Dialog for the user. The user can decide if/where/how they want to print.

Now, there is a rather convoluted work-around. I coded a system for a financial firm that did automated document/form processing. Users would browse to a PDF form, fill it out, and the server would process/validate the information, store in a database, and return the PDF to the user with corrected data. It would then automatically print, silently, to the default printer.

The key is to use a PDF. Embed a PDF JavaScript into the PDF. While the browser object model doesn't have a silent print method, the Acrobat/PDF object model DOES.

That only addresses part of your problem, in that it's still a document-at-a-time.

Perhaps a totally different approach. Provide a zip file with all documents, that the user can download to the desktop and do with what they choose.

tgreer 189 Made Her Cry Team Colleague

I noticed this was unanswered. Speaking only for myself, I don't understand some of your terminology. I don't understand, when you speak of "arrays", whether you mean ASP arrays, JS arrays, or what.

Can you post some sample code? Or just describe in plain English what you're trying to do?

tgreer 189 Made Her Cry Team Colleague

I don't quite understand the question. What is "FP03"?

Let me take a guess? You want users to search the MLS database from your site, but don't want them to "navigate away from" your site?

Easiest approach, make the MLS link open in a new window. That way, when they close the MLS window, your site will still be there, open and ready for the user.

Just add the attribute target="_blank" to your "Search MLS" anchor tag.

tgreer 189 Made Her Cry Team Colleague

I wrote some "setCursorPos" stuff awhile back. Let me search through me archives.

tgreer 189 Made Her Cry Team Colleague

Yep, you're probably thinking of IE's "modal dialogs".

Do the menus have to be dropDOWN? Can they be arranged horizontally instead of vertically:

| Menu | Menu |
MenuItem MenuItem MenuItem

tgreer 189 Made Her Cry Team Colleague

You're fighting the very nature of "frames". They are meant to frame content. You're trying to make content break outside of the frame. You can't do that.

The only thing I can think of as a work-around is to use small, popup windows for your menus.