tgreer 189 Made Her Cry Team Colleague

3-tier refers to separating your code by task. So, you might have all your HTML/CSS/JavaScript (client code) in .aspx pages, then implement all your business logic in ASP.NET "code behind" pages, and all your database i/o as stored procedures in SQL Server.

tgreer 189 Made Her Cry Team Colleague

ASP.NET produces HTML. The ASP.NET objects each "render" an HTML element, specific to the browser/OS/version. So whatever rules apply about mixing and embedding script with HTML applies as well.

The PAGE object has the "AddStartupScript" method, which doesn't do what you think it might (code the onload event of the body), but rather adds a script body to the end of the page.

tgreer 189 Made Her Cry Team Colleague

Digital Camera?

tgreer 189 Made Her Cry Team Colleague

Did you look at the documentation for the "Save" method? I'm not trying to be mean, but if you want to be a succesful programmer, you'll have to learn to read documentation, plus (a personal pet peeve of mine), type and punctuate clearly. You can't refuse to read documentation, and be sloppy in your questions, spelling, and punctuation, and find many people willing to stick with you through a problem.

According to the MSDN Documentation, the Save method of the Icon object takes a Stream as its argument. So, you'll need to create a Stream Object.

If you don't know what a Stream Object is, then you'll have to read up on it. There isn't a quick and dirty solution I can give you. So far you've got a bitmap, and extracted an icon object from it. You know it has a "save" method, and you know it saves it to a "stream" object. You have links to the documentation for the method and the Stream object.

Take it from there!

tgreer 189 Made Her Cry Team Colleague

Please spell out all your words; otherwise we can never communicate clearly.

I've shown you how to convert a bitmap into an icon. I've shown you that you can save the icon to disk, if you like, using the .Save method of the System.Drawing.Icon object. I've also shown you how to set the Form's icon to your icon object using the "this.Icon" property.

What else do you need to know?

tgreer 189 Made Her Cry Team Colleague

Wherever you want it to go... it's only an icon object. If you want to save it to disk, then you would add code to do that (use the "Save" method of the Icon object). If you want to set the icon as the icon of your form, you would use "this.icon = i;".

tgreer 189 Made Her Cry Team Colleague

You need to use the System.Drawing namespace. Something like this should get you started:

Bitmap b = new Bitmap(@"C:\WINDOWS\Blue Lace 16.bmp");
IntPtr hIcon = b.GetHicon();
Icon i = Icon.FromHandle(hIcon);
tgreer 189 Made Her Cry Team Colleague

I'm not busting your chops, and it isn't "stupid stuff". I'm educating you so that you can use the term correctly. If you attempt to search for it, you should know the correct spelling, "cul de sac". The individual terms aren't capitalized, and it's often hyphenated as "cul-de-sac".

I already explained I've never heard the term used in the context of web development. I suspect you saw the term being used in its original sense, meaning a "dead end" on the web, and not as a technical term. I can imagine an SEO company using the term to explain that your site is a dead-end and that they can help you get more "traffic". I can also see how the term might apply to a page on your site with no hyperlinks or navigational elements. The user would have to "back-up" out of the page, thus it might be called a cul-de-sac.

Perhaps if you explained what it is you would like to do, you might get more worthwhile answers. As it is, people could only answer "yes" or "no" to your question. I'm assuming you want to do something specific. If you would expand your question a bit, I'm sure you'd get answers that you'd find more valuable.

tgreer 189 Made Her Cry Team Colleague

It's actually "cul de sac", a French expression for "bottom of the bag", and is pronounced well, more like it's spelling would suggest than "coldasack". It's a term used for any "dead-end", including roads.

All of that aside, I've never heard the expression in the context of web development, sorry.

tgreer 189 Made Her Cry Team Colleague

You never said before, that you were working with PHPBB. If you don't understand the CSS suggestion I made, and don't know how to work with PHPBB's templating, then I suggest your best place to get help would be the phpbb site itself.

tgreer 189 Made Her Cry Team Colleague

Look at Server.Transfer(). How is this question related to a "parameterized query", by the way?

tgreer 189 Made Her Cry Team Colleague

Understood. Your next assignment, then, is to research "offsetTop" and "offsetParent".

tgreer 189 Made Her Cry Team Colleague
tgreer 189 Made Her Cry Team Colleague
tgreer 189 Made Her Cry Team Colleague

Brinnie with an "I", I don't understand the question. There is a site which takes text files, and you want to force-feed it HTML instead?

tgreer 189 Made Her Cry Team Colleague

You never followed-up. Did you my post make sense? How are your JavaScript efforts going?

tgreer 189 Made Her Cry Team Colleague

I get no such message. You're probably testing/loading your pages LOCALLY. IE will indeed block scripts in pages that you load from your local file system. You can't, as far as I know, turn it off.

But never fear, people who browse to your page don't get the warning.

tgreer 189 Made Her Cry Team Colleague

That's a lot of code to debug... really more than I want to try. Where did you get the script? It might be best to contact the script author.

tgreer 189 Made Her Cry Team Colleague

Looks fine to me, in FireFox. I'm assuming "static background" means a fixed background, one that doesn't scroll when you scroll the page content. That isn't a pleasant effect, though, in my unsolicited opinion :).

tgreer 189 Made Her Cry Team Colleague

I'm just re-reading through the threads, making sure all loose ends are wrapped, etc. I notice you never implemented the changes to fix IE.

Perhaps you never saw my latest reply? It will tidy everything up, I promise!

tgreer 189 Made Her Cry Team Colleague

Research the JavaScript "scrollTo" method, then post a follow-up if you have any specific questions about it.

tgreer 189 Made Her Cry Team Colleague

Following my pattern in the C# forum, I'll answer my own question.

The issue is that the LocalSystem account, which most services run under by default, runs in it's own context. Thus, it doesn't have access to USER drive mappings.

Or, as a very obscure and unenlightening MSDN Article puts it:

A service that runs under a LocalSystem account or under a local user account can only access mapped drives that the service creates. Mapped drives are stored for each logon session. If a service runs under a LocalSystem account or under a local user account that does not create certain mapped drives, the service cannot access these mapped drives. Additionally, a service that runs under a local user account that creates certain mapped drives also receives a new set of mapped drives if you log off and then you log on again as the same local user.

The article then goes on to display massive code listings as a "work-around". Ignore all of that. The two relevant pieces of information are that you cannot use DRIVE MAPPINGS.

You can, however, use UNC Paths:

\\COMPUTER_NAME\SharedFolder\

The second clue is that the account used by the service, and thus by extension all processes it spawns, must have rights to the share. A "LocalSystem" account on a specific machine has no such rights. So, the service must run under a "User Account".

That's an inconvenience, to be sure, but can be handled by …

tgreer 189 Made Her Cry Team Colleague

You can't. This is fundamental "user interface" 101. A programmer shouldn't attempt to force actions that are historically under user control. Also, what you're attempting violates the browser security model. Just imagine the havoc that would be caused if a web page could "silently download" anything as soon as you browse to it.

I understand you simply want the dialog to pop up, but it's still not allowed.

tgreer 189 Made Her Cry Team Colleague

Is there no brave soul willing to take a stab at this? Let me re-hash it in case the above isn't clear.

I get the following error:

An unhandled exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll

Additional information: Could not find a part of the path "z:\".

The code that causes the error (I'm using the "PHP" tags, but this is C# code, of course):

if (!Directory.Exists(sack_destination + tape_name))
{
  Directory.CreateDirectory(sack_destination + tape_name);
}

"sack_destination" is a string that equates to "z:\mer". This is a mapped drive, a network share.

The code is contained in a Console Application, which is launched from a Windows Service application using System.Diagnostics.Process.Start.

I have tried running the service under the LocalSystem account, and as a local user account with Administrative + "run as service" privileges. The same error in each case.

I also tried running the service under NetworkResource account, but the service failed to start, with no specific error message, so I'm not sure what the problem is there.

The error does NOT occur when I manually run or debug the Console application.

What privileges are needed in order for an application spawned by a service to access network resources? Can those privileges be granted programmatically? In other words, can the service launch the process with specific credentials? If so, how (code snippet)?

tgreer 189 Made Her Cry Team Colleague

Brief Summary

I've written a Windows Service. It uses Process.Start() to launch a Console Application. The console application performs a File.Copy(), to copy a file from the local file system to a network share.

Problem: The file copy fails. I get an exception that tells me "part of the path could not be found".

When I run the Console Application directly, I don't get the error.

My Guess: I'm guessing that services, and processes spawned by services, do not have permissions to access non-local resources, including network shares.

My Attempted Fix: Run the service under a different user account. It didn't work.

Details

This is for a large transactional processing job. There is a dedicated server that periodically receives (through web services) thousands upon thousands of "transactions". These take the form of individual files, organized into a 5-level hierarchy. Each level has a folder, so the folder structure might be:

C:\OUTPUT\LEVEL_A\LEVEL_B\LEVEL_C\LEVEL_D\files

The "files" represent the individual transations. When a particular "LEVEL_D" is complete, a log file is created.

It can take DAYS to generate all the files. Currently, when the process is complete, someone manually organizes and processes the transations. Yuck.

My Windows Service implements a FileWatcher to look for the creation of the "log" files. When a log file is created, that means there is a "batch" of transactions that can be processed. When a log file is completed, I use System.Diagnostics.Process.Start() to launch a Console Application.

…

tgreer 189 Made Her Cry Team Colleague

That's because "disabled" isn't a client-side property of the rendered control. It's a server-side property that makes no sense in the browser.

There isn't a way to "disable" a hyperlink, per se. What you can do is define a hyperlink CSS class that "looks" disabled, and then you can change the "href" property to navigate back to the top of the page, rather than submitting the form or going off somewhere else. Server-side, you'll also have to turn off the auto-postback of that element.

So, here's some CSS and JavaScript to make the hyperlink appear disabled, and navigate to page top:

The CSS:

.disabledHyperLink
{
  color: #333;
  text-decoration : none;
  cursor: default;
}

The JavaScript:

function disableHyperlink(linkID)
{
  var hlink = document.getElementById(linkID);
  if(!hlink)
    return;
    
  hlink.href = "#";
  hlink.className = "disabledHyperLink";
}

Your server code:

Private Sub DataGrid_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid.ItemCreated
            If (e.Item.ItemType = ListItemType.Pager) Then
                e.Item.Attributes.Add("onclick", "disableHyperlink(this.ID);")
                e.Item.autopostback = false
            End If
        End Sub

All code untested and subject to revision/debugging!

tgreer 189 Made Her Cry Team Colleague

Not directly, no. Server-side functions live server-side, client-side functions live on the client.

In fact, the only way to get ANY server-side code to run, is to submit the form. ASP.NET unrolls the HTTP headers, unpackages the hidden ViewState variable, re-instantiates objects, and then decides what events to raise based on all of the above.

What you can do is have your JavaScript function set a hidden form variable, then do a form.submit().

Then, in your Page_Load handler on the server, use the Request object to check for the presence and/or value of this variable, and call the appropriate server-side method.

tgreer 189 Made Her Cry Team Colleague

Save the values into cookies.

tgreer 189 Made Her Cry Team Colleague

With CSS, you set the margin of your main content block element to "auto", and it will automatically center, even if the content itself is given a width.

If your main content is contained in a div, you might give that div the class "container", and your CSS declaration might look like:

#container
  { position: relative;
    width: 656px;
    background: #ccc;
    border: 15px solid #666;
    margin: 0 auto;
    padding-bottom: 5px;
  }

The margin says, make the top/bottom "0", and make the sides "automatic".

tgreer 189 Made Her Cry Team Colleague

Sure. Add on onChange handler:

<select name = "product" class="buy" onChange="JavaScript:mySelect(this);">

Code the mySelect function in the head/script section:

function mySelect(x)
{
  window.location.href = "http://www.your_domain.com/"  +   
     x.options[x.selectedIndex].value;
}

Some variation of that ought to do the trick.

tgreer 189 Made Her Cry Team Colleague

Loads it where?

Look at some of the code in this article: Creating an HTML "ComboBox" control

It demonstrates all the techniques you'll need to reference Select/Option controls, retrieve their values, and copy them into other controls.

tgreer 189 Made Her Cry Team Colleague

Actually, that's achieved by setting the border property. CSS allows you to set border-top, border-bottom, border-left, and border-right, independently.

You can also set the border width and style, to get a grooved or inset border.

So, search for "CSS border properties", and you should be on the right track.

tgreer 189 Made Her Cry Team Colleague

There isn't a solution unless there's a problem: nothing "wrong" is happening. What you're experiencing is a by-product of the way frames work. I would suggest you go to the PHP forum and inquire about "URL rewrite" or mod_rewrite, or search the internet for those terms.

tgreer 189 Made Her Cry Team Colleague

This is expected. The address bar shows the address of the page the user is on, which in the case of frames, is the frameset page. Since the user isn't navigating away from the frameset page, the URL in the address bar doesn't change.

tgreer 189 Made Her Cry Team Colleague

The main problem you have is understanding variable scope. When you use the keyword "var" INSIDE A FUNCTION, you are declaring that the variable is local, or scoped to that function. That being the case, your "changetext" function cannot access the objects you create in your "creatediscription" function.

Examine the code I have below, which is what you're trying to achieve, I think. I have removed the "var" keyword, making those objects global in scope.

I've also modified the "changetext" function to use "documentGetElementById" and the "innerHTML" property, to illustrate their use.

Have fun!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
<html> <!--HTML Transitional Javascript Test Page-->

<!--Header Information-->
<head>

<!--Page's Title-->
<title>Test Page</title>

<!--CSS Styling Information-->
<style>
/*Class Specific Styling Information*/
div#navbar
{ 
   background-color: #00FF00;
   position: absolute;
   top: 0px;
   left: 0px;
   width: 100%;
}

div#navLinks
{ 
   float: left;
}

div#linkDescriptions
{ 
   background-color: #FFFF88;
   margin: 10px 10px 10px 10px;
   width: 100%;
}
</style>

<!--Scripting Information-->
<script type="text/javascript">
//Create the Link Descriptions div.
function createdescription()
{ 
   navbar = document.getElementById('navbar')
   linkDescriptions = document.createElement('div');
   linkDescriptions_textNode = 
     document.createTextNode('Hover over a menu for a description.');
   linkDescriptions.id = "linkDescriptions";
   linkDescriptions.appendChild(linkDescriptions_textNode);
   navbar.appendChild(linkDescriptions);
}

function changetext()
{
   document.getElementById("linkDescriptions").innerHTML = "Test.";
}
</script>

</head>

<!--Body Information-->
<body onload="createdescription();">
<div id="navbar">
  <div id="navLinks">
    <p>
      <a href="#" onmouseover="changetext();">Main</a>
    </p>
  </div>
</div>
</body>

</html>
tgreer 189 Made Her Cry Team Colleague

I'm sure a few of us can take a crack at it. However, what you're trying to dol really isn't typical. Hyperlinks should be self-descriptive:

<a href="order_processing.php">Complete your order</a>

"Complete your order" describes what the hyperlink does. Now, I can imagine a scenario where you would like to give your users a fuller explanation of what some hyperlinks do. But physically changing the text of the hyperlink isn't a solution I'd consider. I would

1) set aside an "explanation" portion of the page, perhaps as a <div> element.
2) when the user hovers over a link, change the contents of the <div> element to explain what that link does.

or, alternatively, provide a help system that explains each link, and reference it near the links:

If you're not sure what to do next,
please refer to the <a href="help.html">online help system</a>.
tgreer 189 Made Her Cry Team Colleague

The problem really is with the display: block, though. If you want to treat it as a block element, you really have to deal with it as a block element. That means setting explicit "position" and "height" properties.

This should fix the issue:

#sidebar .sidebox a, 
#sidebar .sidebox span {
	border-bottom: 1px solid #fff;
	color: #5C5D60;
	position: relative;
	height: 10px;
	display: block;
	padding: 4px 2px;
	text-decoration: none;
}
tgreer 189 Made Her Cry Team Colleague

Use DIVs, and CSS visibility settings. For an example: http://www.brownfedora.com/

tgreer 189 Made Her Cry Team Colleague

Remove the line in red. You're trying to display an inline element in "block" mode, and that is causing IE to add the extra space.

Firefox, on the other hand, just ignores it.

#sidebar .sidebox a, 
#sidebar .sidebox span {
	border-bottom: 1px solid #fff;
	color: #5C5D60;
	display: block;    
	padding: 4px 2px;
	text-decoration: none;
}
tgreer 189 Made Her Cry Team Colleague

You should post this in the Java forum, if you really mean "Java". It could be that you need to install the latest version of the Java Virtual Machine. If you mean "JavaScript", then check your security settings under Internet Options, to see if you have enabled JavaScript or not.

If you still have problems, then perhaps the best forum for configuration advice would be the "Web Browsers" forum: http://www.daniweb.com/techtalkforums/forum29.html

THIS forum, deals with developing/programming web pages.

tgreer 189 Made Her Cry Team Colleague

Sure, no problem.

tgreer 189 Made Her Cry Team Colleague

I'm sorry, but to post a URL is against DaniWeb policy. You can, however, post code snippets for us to examine.

tgreer 189 Made Her Cry Team Colleague

No, I mean using CSS. Sure, I'm using DIVs to contain the content, but "using DIVs" doesn't give you columns. One has to use CSS to achieve that effect.

tgreer 189 Made Her Cry Team Colleague

You can look at my site, shown in my signature, for an example of 3-column layout using CSS, instead of tables. The middle column expands or shrinks with the size of the browser.

tgreer 189 Made Her Cry Team Colleague

Ditto.

tgreer 189 Made Her Cry Team Colleague

I moderate this forum; I deleted the URL. It's daniweb policy, for good reasons. I sent a private message to the original poster, explaining how to post HTML and CSS code within a message. You'll also note how I provided an alternative to using images, which is to apply CSS to standard hyperlinks.

Telling someone that their efforts are "crap" and that they don't know HTML and CSS isn't really in the spirit of things. However, I'm willing to grant you the benefit of a doubt and suppose that was just poor wording and not a personal attack. So, we'll all watch this thread and see if he comes back with more questions, and do our best to assist. Agreed?

tgreer 189 Made Her Cry Team Colleague

I haven't researched your specific issue, but it isn't necessary to use images as buttons or hyperlinks, unless you want buttons like you see on daniweb, with an image background.

Using CSS, you can style regular hyperlinks to look and function as buttons.

<html>
<head>
<style type="text/css">
a:link, a:visited
{
  float: left;
  margin: 2px 5px 2px 5px;
  padding: 2px;
  width: 100px;
  border-top: 1px solid #cccccc;
  border-bottom: 1px solid black;
  border-left: 1px solid #cccccc;
  border-right: 1px solid black;
  background: #cccccc;
  text-align: center;
  text-decoration: none;
  font: normal 10px Verdana;
  color: black;
}

a:hover
{
  background: #eeeeee;
}

a:active
{
  border-bottom: 1px solid #eeeeee;
  border-top: 1px solid black;
  border-right: 1px solid #eeeeee;
  border-left: 1px solid black;
}
</style>
</head>
<body>
<a href="#">Button 1</a><a href="#">Button 2</a><a href="#">Button 3</a>
</body>
</html>
tgreer 189 Made Her Cry Team Colleague

You cannot directly embed images in HTML. HTML is a set of instructions. One of those instructions is "put this image, here". The browser/client must retrieve the graphics when it processes those instructions. So what you're seeing is a problem in Outlook, not the HTML.

If you want absolute fidelity of your graphic design, you might consder sending a PDF file, instead of HTML.

tgreer 189 Made Her Cry Team Colleague

If you want to use books, I like the "Visual QuickStart" series.

tgreer 189 Made Her Cry Team Colleague

alpha_foobar: we're straying off topic, but I think the discussion has some merit, so I'll forge ahead.

I'm a web-developer (actually, an application developer who often writes web-enabled applications). Over the years I've come to the conclusion that any web application must use both server-side code and client-side code.

I've also realized that most new web developers don't understand that. Many are entering web development from the graphic design field, and so are very used to working with user interfaces. For them the natural assumption is to try to do everything via client-side code.

As a contrast, many ASP.NET developers come from traditional desktop Windows development, and so have no concept of client-side code. In fact, they often resort to (because ASP.NET encourages) the most bizzare server-side code contortions, when what they really should use is a client-side function.

So, yes, I often indeed recommend a server-side solution, because I'm not speaking from a pure theoretical "how would you do this in JavaScript" viewpoint. I try to speak from a real-world practical, "here's how to approach this" viewpoint, realizing that most posters have only a fuzzy concept of client vs. server.

It's ironic, I agree, that in the JavaScript forum you'll often see me recommending a server-side solution, while in the various ASP.NET fora, you'll find me preaching the client-side gospel.