Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Did you visit my site? Because it works like that.

Basically if the screen width is wider than the content DIV (mine was set at 800px) then there is no horizontal scroll bar and the content DIV is centered horizontally.

Once inner browser width < div width the div will stop repositioning and you will get a scroll bar to accomodate the div width.

|<-------------Inside width of browser------------->|
|<--------Width of DIV-------->|
No Scroll Bar

|<-Inside width of browser->|
|<--------Width of DIV-------->|
Scroll Bar

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Sorry, I must've been editing my post while you were asking your question but I added both CSS and HTML examples as well as a link to my site so you can see the results of how it all comes together :) The CSS is stored in a separate file so it can be re-used on all the pages in your site instead of having to re-do <style> tags on each page.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Niths;

Generally the easiest way to achieve a 'dynamic' page size is via CSS as you said.

One tried and true method is to use nested DIVs within a wrapper DIV to provide a fluid background and content positioning over top of a filler (stationary) background.

The concept is that you use a "wrapper' as a container to hold everything else. Think of the wrapper as the layer of an image that is furthest to the back.

From there you use nested DIVs moving forward in layers until you reach the top-most layer of your content. Something like:

Wrapper(BG DIV(Content DIV)))

Basically the wrapper contains the 'primary' background (stationary) over which the dynamic background DIV floats. Within that is the content itself sized to fit within the background imaging.

It doesn't always need to be as complex as what I've indicated, I'm just giving an example from how I did mine. I used the <body> as my "wrapper" giving a flat #CCCCCC background colour and some of the body-wide formatting to the #Body class in my CSS. I used the first <div> as my sized/centered background image container (my dynamic background is actually encased in 2 DIVs as Internet Explorer won't allow a multiple background image like other browsers will) which is 800 px wide with left and right margins set to auto so it automatically floats left/right based on the browser window size it's being shown in. My inner DIV is used …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I tried to duplicate this with Fireworks CS4 to see if I could find a solution for you.

What I did was typed some text onto a blank frame in Fw to see what was available for styles.

Without doing anything additional I had 0 styles available in the properties of the text and no immediately visible styles in the Styles picker under "Current Document".

However, there were still the adobe provided styles in the Styles picker if I changed it from "Current Document" to one of the built in style libraries and once a style was selected from there it was imported into the current document list and added to the style dropdown for the text properties as well.

My thought here, and I'm only guessing at this stage, is that you may need to either import a custom style library or you may have somehow damaged your adobe provided style libraries and may need to re-install them. Either that, or you just have no styles previously used in your document and need to import them.

Otherwise I'm not seeing any reason why Fw would refuse to allow a style modification to text based on what the CS4 version does for me (again, I'm not using same version as you I don't think).

In CS4 Ctrl-F11 opens the styles window where you can select from the pre-built styles or import new libraries so dunno if that'll help for you or not.

Hope …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Y'see, I was all "I've got the solution" after I fixed something similar on my own page but then I looked at your snippets again and saw that your body class already has margin-top: 0;

What I might recommend, however, is to check your page conainer by container (body, divs, etc) and ensure that the top 2 containers of your page have 0 top margins either through CSS or via topmargin="0" as that was the only thing in my site that was causing any downward shift of the top area of my page.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'll start by saying your request is VERY vague, but I'll do what I can with it :P

What I'm going to do is give a general "do's and don'ts" list based on my own experience (keep in mind opinions vary and this is not a definitive list).

Do:

  • Ensure that your background is tasteful and simple. There's nothing worse than a flashy overblown background to distract from your site content. Don't be afraid to be creative with your background to some degree but remember it's a background, not the center of attention.
  • Ensure that your images and other multimedia content are of reasonable file size. This cuts down on page load time for slower connections and improves user experience. Some people have an unfortunate habit of having images that are much larger than they are being displayed (ie: a 300px x 300px image being constrained to 50px x 50px) and it is simply unnecessary to have the added filesize if you're not going to make use of the extra resolution.
  • Don't go overboard on 'bells and whistles'. It's one thing to provide appropriate multimedia content to present your idea/product but if there's too much going on in the page it can again be distracting to your audience.
  • Try to keep your site well organized. Ensure that navigation structures remain uniform throughout the site to eliminate confusion for your users. Try to keep the number of steps required to get from point A to point B to …
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I believe that this post might give the right direction on how to proceed with what you're looking for.

It outlines the use of restricted vs unrestricted tokens in the UAC. Now, I don't believe XP uses UAC (User Account Control) as I think it's a Vista/7 thing but I would imagine that the process would be similar even under a different umbrella.

This post may get you closer as it indicates a method of impersonating Administrator in XP but appears to have some drawbacks (such as the user needing to know the administrator password, in which case why not just have them log in as administrator to begin with).

Unfortunately, I haven't been able to find much on running at administrator level in XP but I have found lots on setting permission tokens in Vista/7... Sorry.

Hope this helps anyway :) Mark as solved if it does.

kvprajapati commented: Words!!! +10
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

For starters I would define your queries as global variables in your code-behind:

string queryString1 = "default starting string here";
    string queryString2 = "default starting string2 here";

I would then proceed to call these strings in the required data population procedures.

For your link you can go about it in a couple of ways.

If you're using a hyperlink you can use something along the lines of http://yoursite.com/codedpage.aspx?passedinstruction and parse the ClientQueryString value with:

string getQuery = ClientQueryString; //obtain variables from passed link ?passedinstruction

and parse as necessary depending on what variables you decide to pass to activate the required queryString change.

If you're using buttons, you can modify the querystrings directly with the onClick function of the button and reload the page (if necessary) with the Response.Redirect(http://yoursite.com/codedpage.aspx) call.

For the dynamically created URLs you can set your hyperlinks to <asp:hyperlink> type or buttons can have variables set dynamically in the way they modify the querystrings based on whatever processes you specify in your onClick.

Hope this helps :) If it solves your issue please mark as solved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

A couple of things are bothering me about the code above from what I'm reading.

  1. the form tag only encompasses the submit button
  2. the only asp compatible element in the page is the submit button

While you have set the cmd.Parameters to pull values from the various inputs on the page, I don't believe elements that are outside of the <form></form> constructs will be actively read by the C# code-behind.

I believe that, as much as you 'like' the way the page looks with the current layout, you may need to convert the inputs into proper asp inputs and enclose them within the form for this to work properly.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, so what I'm reading is that you are getting this as a result of viewing a published page on a web-server, is that correct?

Again, it would still help to have some code samples provided of the portions of the application that are responsible for generating authentication. Alternately, if your application is not what is causing the authentication request then it is possible that your hosting directory was set up incorrectly in your web-server and is requiring you to log in to the directory which would be unrelated to the application.

As indicated above, it is difficult to troubleshoot without more information so if you can provide some details on the following it might help figure out the source of the problem:

  • Is the web-app hosted locally on your development machine or on an external web-server?
  • Is the directory the web-app is hosted from a password protected directory on your web-server?
  • Is there a portion of your code that requests user authentication within your web-app? If so, can you please share the code so we can see it.

In the end your authentication issue is derived from 1 of 2 places, your application code or your web-server. Knowing which one will majorly narrow down the troubleshooting to solve your problem :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

While I don't believe the example you are attempting is possible (to my knowledge) as you can't determine a button based on it's position within a table (again, to my knowledge)...

I think you could probably get away with 1 event handler that assigns different events based on which button calls it.

Realistically it would be better all around to have separate event handlers if you're going to be performing separate tasks. However, if your tasks are generally identical with minor differences (ie: a different variable value) depending on which button is pressed you could use the following to achieve this:

In the .aspx page my example uses this ~

<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" onclick="btn_onclick" />
        <asp:Button ID="Button2" runat="server" Text="Button" onclick="btn_onclick" />
        <asp:Button ID="Button3" runat="server" Text="Button" onclick="btn_onclick" />
        <br />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </div>
    </form>
</body>

And in the code-behind it uses this ~

protected void btn_onclick(object sender, EventArgs e)
    {
        if (sender.Equals(Button1))
        {
            TextBox1.Text = "Button1";
        }
        else if (sender.Equals(Button2))
        {
            TextBox1.Text = "Button2";
        }
        else if (sender.Equals(Button3))
        {
            TextBox1.Text = "Button3";
        }
    }

The result is that the btn_onclick checks the sender against the various buttons until it finds a match and performs it's task based on that.

Hope this helps :) Please mark as solved if this resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

There are a number of decent tutorials at this link for manipulation of data both to and from Excel files.

As a side note there are likely a number of other tutorials available and this is just one of many examples I found with a quick Google search. :)

Hope this helps, please mark as solved if it does.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Are you running it from Visual Studio in debug mode? or from "view in browser"?

Or is the site live and uploaded to a web server and giving this error?

Any chance you can provide an example of the code you're using for the authentication popup (minus any user/password sensitive information of course) so we can see what your code is doing and possibly help troubleshoot for you?

Love to help but without more info I'm afraid there's not much to work with here :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

The same should apply whether it's a web app or a windows app. the only difference is that the radiobox doesn't need to have permission set on it. And I stand by the link in my previous response for the method involved in connecting to the Access DB :)

As a side note, if this is web-app related, it probably should have been posted in the ASP.Net forum instead of the C# forum.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Hehe... nevermind... I found my solution! :P

function toLink() {
    var url_string = prompt("Enter fully formed URL here","http://yourURL.com");
    while (!url_string) {
        continue;
    }
    if (url_string != "http://yourURL.com") {
        var tb = document.getElementById("msgBody");
        if (document.selection) {
            str = document.selection.createRange().text
            document.selection.createRange().text = "[l " + url_string + "]" + str + "[/l]";
            return true;
        }
        else if (tb.selectionStart) {
            var startPos = tb.selectionStart;
            var endPos = tb.selectionEnd;
            var str = tb.value.substring(startPos, endPos);
            tb.value = tb.value.substring(0, startPos) + "[l " + url_string + "]" + str + "[/l]" + tb.value.substring(endPos, tb.value.length);
            return true;
        }
        else {
            return false;
        }
    }
    else {
        var tb = document.getElementById("msgBody");
        if (document.selection) {
            str = document.selection.createRange().text
            document.selection.createRange().text = "[l]" + str + "[/l]";
            return true;
        }
        else if (tb.selectionStart) {
            var startPos = tb.selectionStart;
            var endPos = tb.selectionEnd;
            var str = tb.value.substring(startPos, endPos);
            tb.value = tb.value.substring(0, startPos) + "[l]" + str + "[/l]" + tb.value.substring(endPos, tb.value.length);
            return true;
        }
        else {
            return false;
        }
    }
}
Ancient Dragon commented: Good work :) +31
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, so I found a solution that works for a simple transfer like adding bold tags (yes, I had to delve into JavaScript to do it).

The problem I'm running into now is, how do I do the same kind of replace while using an input source such as the prompt() function?

function toLink() {
    var url_string = prompt("Enter fully formed URL here");
    if (url_string != "") {
        var ta = document.getElementById("msgBody");
        if (document.selection) {
            str = document.selection.createRange().text
            document.selection.createRange().text = "[l " + url_string + "]" + str + "[/l]";
            return true;
        }
        else if (ta.selectionStart) {
            var startPos = ta.selectionStart;
            var endPos = ta.selectionEnd;
            var str = ta.value.substring(startPos, endPos);
            ta.value = ta.value.substring(0, startPos) + "[l " + url_string + "]" + str + "[/l]" + ta.value.substring(endPos, ta.value.length);
            return true;
        }
        else {
            return false;
        }
    }
    else {
        var tb = document.getElementById("msgBody");
        if (document.selection) {
            str = document.selection.createRange().text
            document.selection.createRange().text = "[l]" + str + "[/l]";
            return true;
        }
        else if (ta.selectionStart) {
            var startPos = ta.selectionStart;
            var endPos = ta.selectionEnd;
            var str = ta.value.substring(startPos, endPos);
            ta.value = ta.value.substring(0, startPos) + "[l]" + str + "[/l]" + ta.value.substring(endPos, ta.value.length);
            return true;
        }
        else {
            return false;
        }
    }
}

This is what I'm trying to do and if I was doing it in C# it would work, taking an input and applying it to the processes below it. When I try to test it however, it gives me the input (prompt()) but doesn't give any results in my textbox.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I've been building a custom journal application for my website which has a reply sub-app where visitors can post responses to my frequent posts.

In the response sub-app I want to be able to incorporate formatting buttons (bold, link, colour, etc) that will take selected text within the textbox and add the appropriate format codes on either end of it.

The problem I run into is, without incorporating javascript to manage the formatting buttons I can't seem to find the equivalent of textbox.SelectedText within ASP.Net to determine the selected component of the textbox for the parse/replace code required to make this happen via C#.

While I've been trying to keep the application 100% C#/ASP.Net I am curious if anyone has any suggestions on how to go about getting a SelectedText type replace where I can take, for example "visit my site" as a selected segment within the textbox and through a button within the page convert it to [l http://mysite.com]visit my site[/l]. For this example I would also need some sort of pop-up input field where the user could enter their URL.

I've seen some examples of how to (just using C#/ASP.Net) open a child window, enter a variable, and return the variable to the parent but I haven't yet found a way to work on only a selected portion of a textbox's content.

I haven't added any code here simply because this is a prospective addition to my app and …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Generally I don't get a lot of opportunity to work with filestream type controls because lately I've been doing more ASP.Net than straight up C# coding.

I did, however, find this forum post elsewhere that seems to cover much of the same issue you're asking about and seems to have come to some roundabout answers that might solve your problem.

Hope it helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As Ardav said you can use separate body and wrapper div backgrounds to achieve what you're looking for.

One thing to note (as you mentioned multiple backgrounds I thought I'd bring this up "just in case") is that IE and Firefox (amongst other popular browsers) handle CSS background properties differently from each other.

As an example, in Firefox (and, in fact, in most browsers not IE) you can have 2 backgrounds assigned to one container (body, wrapper, etc) which will allow you to have, for example, a different background for the top, middle and even bottom of your content section of your site. This is achieved by CSS that looks something like:

background-image: url(imgs/bg_top.png),url(imgs/bg_patt.png);
background-repeat: no-repeat,repeat-y;
background-position: top, inherit;

Unfortunately, the use of double variables within a single css parameter is something that IE does not understand and the only way to get a comparable result is by layering divs over top of each other such that your upper background is contained within an upper div, primary background contained within it's own div and so on. All of which can still be portrayed over top of a body primary background.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

What I might suggest is that you do a google search to find any tutorials related to this topic as from what I'm seeing there are several.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm sorry, I did my best to wade through your code but I'm not much on VB. Hopefully someone with more in-depth knowledge of VB and SessionStates will be able to toss back an answer on this one for you.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Just a rough approximation here and you'll need to set up your own connection strings and variables and inputs and such but here's how I'd go about achieving what you're asking for:

protected bool testIt()
    {
        string[] parsedData = test.Text.Split(',');
        blConn connector = new blConn();
        string connStr = @connector.cString;
        SqlConnection insertConn = new SqlConnection(@connStr);
        SqlCommand insertCmd = insertConn.CreateCommand();
        insertCmd.CommandText = @"INSERT INTO dbNameHere (id,description,etc) VALUES (@id,@desc,@etc)";
        insertCmd.Parameters.Add("@id", SqlDbType.Int);
        insertCmd.Parameters["@id"].Value = Convert.ToInt16(parsedData[0]);
        insertCmd.Parameters.Add("@desc", SqlDbType.VarChar);
        insertCmd.Parameters["@desc"].Value = parsedData[1];
        insertCmd.Parameters.Add("@etc", SqlDbType.VarChar);
        insertCmd.Parameters["@etc"].Value = parsedData[2];
        insertConn.Open();
        int confirm = insertCmd.ExecuteNonQuery();
        insertConn.Close();
        if (confirm == 0)
        {
            return false;
        }
        else
        {
            return true;
        }
    }

In my example above blConn is actually an invoked class containing my connection string to my DB.
Hope it helps :) Mark as solved if it resolves your issue.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Based on the limited amount of code provided I'm speculating it could be one of two things here:

  1. The code in MasterAdminUsers.aspx is calling a resource it doesn't have permission to call (is the gridview unbound? bound? is there any code associated at all with the MasterAdminUsers.aspx page that invokes any sort of action on the part of the webserver or towards a DB server?)
  2. The settings in your webserver prohibit the use of Response.Redirect()

I can't see anything else here that would be causing those issues as you've described them so far.

Hope this helps in some way :) Mark as solved if this resolves your issue.

P.s.: As a side note I really hope that is not your 'end result' for security in logging into an admin portion of your site. It's just my personal way of doing things but even if I only have one login account for something I always mask my login variables by either storing them on a SQL server table or by having them in a separate (and less directly accessible) class definition. However, I'm assuming here that you've just done the provided code for testing reasons :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Excellent!! Please remember to mark solved problems as solved to close the thread :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Hi,

Actually I am php developer so can't provide you the code in dot net but general idea is to use the percentage in width field.

Try to use the percentage in width attribute as below :

<table width ="100%">

<tr><td width="25%>...</td></tr>
<tr><td width="25%>...</td></tr>
<tr><td width="25%>...</td></tr>
<tr><td width="25%>...</td></tr>

</table>

I hope this would help.. :)

While I generally use percentage widths in my content I am curious however... how does this work towards the requirement of one column needing to be variable in width to accomodate changing lengths of input compared to the other columns being relatively static in width?

Not trying to shoot down your answer but just curious because if your solution works with less effort than mine then he should definitely go that way :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Sorry, was trying to do what I could with what was provided but did you look into adatapost's suggestion at all? I had completely forgotten about that option when I was posting my original reply :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, some methods have been given already but here's a couple of tutorials to help with different ways of getting DB info to Excel spreadsheet format.

First is a tutorial to do it directly from MS SQL Server

Second is a tutorial on doing it in VB.Net and C# which also includes exports to other file types as well.

Hope this helps :) Mark as solved if your problem has been resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm not at all sure if it works or not because I've never needed just one variable width colum in a table...

But from looking around I'm seeing the possibility of using:

<td style="width: auto">

Alternately, if you know the pixel value for the width of a standard character in the size you are using...

<td id="tdVariable" runat="server">

With the following code-behind.

int charWidth = 20;
    int addrWidth = Label_Address.Text.Length;
    int intWidth = Label_Interests.Text.Length;
    if (addrWidth > intWidth)
    {
        tdVariable.Width = charWidth*addrWidth;
    }
    else
    {
        tdVariable.Width = charWidth*intWidth;
    }

This should produce a table column of the appropriate width to support the contents depending which of the above returned variables is longer.

I don't know if this is what you're looking for but I hope it helps :) Mark as solved if it clears up your problem.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... my bad for not being clearer on the specific relevant part of it :icon_razz:

Your connection is showing open because it is never closed unless the button is clicked.

Therefor in the event of multiple loads it is trying to open an already open connection.

Same situation happens with your reader which is never disposed of in your code.

This is why I provided example code above to indicate what would be a better overall setup for your code to prevent these things from happening. ;)

Edit: This is also why I recommended placing your connection into either a separate function or into the click event so that the connection is only called as needed and not opened in the page_load() where it can attempt to re-open on postback or page reload without having closed first.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Did you, at some point in the project, change the project's source directory at all?

Basically it's sounding to me like it's looking for your files at 'C:\users\lizane\desktop\project\peek-ture\peek-ture\bin\x86\debug\peek-ture.exe' but they're either not there at all or in a different location.

The 2nd part of the message indicates a possible solution by telling you to "please build the project and retry, or set the outputpath and assemblyname properties appropriately to point at the correct location for the target assembly."

If, in fact the source directory has been moved for the project then all you need to do is re-point the project configuration to the correct location and you'll be good. Otherwise performing a manual build may cause the appropriate files to re-populate in the directory VS is looking for them in.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

For starters the error "503 This mail server requires authentication when attempting to send to a non-local e-mail address." generally indicates that you need to be using UN/PW authentication to log into the SMTP server to send email outside your own domain.

"Your message did not reach some or all of the intended recipients." can be caused by a number of issues ranging from mail servers rejecting the message due to untrusted mail server on your end to mail delivery issues in general.

Overall it sounds like the mail server simply wants you to log in before sending mail to outside recipients and that should solve the issue so change authentication setting on your SMTP server setting to include your account username and password and you should be fine.

That being said... I fail to see how an issue with a 3rd party mail service not working in Outlook 2007 has anything at all to do with ASP.Net lol :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, so you're basically looking for a hosting platform where you can subdivide it into subdirectories and individually allow access to each directory to specific clients to maintain their own content within their directory.

I've seen that somewhere but I can't for the life of me recall where... realistically... if you have a hosting provider already (or your own web server) which allows for multiple FTP accounts you could simply provide unique FTP rights to each user's separate directory and they can manage their content that way... However if you're looking to have a content management suite that allows you to do a "control panel" type deal for each directory as well I'm at a loss because I've never required that sort of product :( Sorry I wasn't of more help.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

well the thing there is if you're using <asp:Hyperlink> that's almost identical to the <a href="" id="urlID"> example I was giving.

you can leave the format as:

<asp:HyperLink ID="eventLink" NavigateUrl="" runat="server">Calendar</asp:HyperLink>

and your code-behind would look like

eventLink.NavigateURL = "default.aspx?id.....";

In this way your URL component of the <asp:HyperLink> is determined at the code-behind level.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Not sure if this is what you're looking for but in the past I've used Host9 for their reseller hosting options.

The up-side is that once you set up a reseller account you have your primary hosting account which gives you access to subdivide your available space into parcels that you can dole out to your clients. Each client gets their own hosting interface and you still have 'master' access to all content under your umbrella.

The down-side is that it can be somewhat difficult to set up the client end hosting packages and options and unless they've drastically changed over the past 2 years Host9 does not have (in my experience) the best customer service or technical support.

They are excellent at answering your questions up until the point where you start paying for the service :P

I only mention them as they are one of many options available for reseller hosting and that seems to be the direction you want.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Actually...

I just found a MUCH simpler and neater solution for you :)

for your static URLs:

<a href="" id="url1" runat="server">test1</a>

and in the code-behind:

url1.HRef = "http://www.test.com";

You can declare an ID and runat environment into your <a> tags allowing you to dynamically set their properties in code-behind. So, essentially, you can declare your side-menu URLs at the same time you declare your in-content links and they will both contain the same information eliminating your problem entirely... unless I've lost track of what the problem was in the first place lol

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Generally I try to keep my responses as positive and helpful as possible. While I'm not always able to give an actual solution I try to do what I can or I don't normally post at all.

However, in the past 24 hours of thread skimming I've come across approximately 75% of the posts I've looked at where no reference code is provided. While not every question requires code examples in order to be resolved, many would strongly benefit from them.

What would probably help here would be code snippets from the areas of your application in which the affected control is in play. By seeing how it is currently being manipulated perhaps one of the many skilled and experienced coders on this site will be able to spot a flaw or loophole and provide a solution for you.

Again, I apologize if this sounds harsh and I'm not 100% directing it at you... you just happened to be the one poster at the end of a long list of several who didn't provide any objective code reference to work with :P

kvprajapati commented: Great Response!!! +10
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ahh, my bad.

Easy way out of that one...

int startInd = (args[1].LastIndexOf('\\') + 1);
    int indLength = ((args[1].Length - 1) - startInd);
    string testString = args[1].Substring(startInd, indLength);

testString should give you all the characters following the last instance of the \ character (the first \ is the escape sequence).

From there, if you're retrieving a single char reference after the \ (ie: '\t' becomes 't') you can convert testString to char.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Have you thought of making the myproj classes into subclasses of the tasklayer class set?

Doing something along the lines of:

public class _C : Tasklayer

An example of setting up inheritance can be found at THIS LINK.

Hope this helps solve your problem :) If it does, please mark thread as solved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I guess to start with...

What, if any, errors are you receiving when you attempt to run this code? This might help to narrow down the specific components of the code to look at.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Based on the example string you provided I'm not sure why you couldn't just use args.Split(' ') to parse s:\nt\dd.tsv \t s:\nt\dd.out since there is a clear space between the arguments.

However... if you're intent on splitting based on string values you might want to look into setting the following at the top of your app:

using System.Text.RegularExpressions;

and utilizing

Regex.Split(string, string)

to perform your parse.

Hope this helps :) If it solves your issue please mark as solved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, well in that case...

If both the created links and the static links are within the same page environment...

You should be able to dynamically determine the static link values with some code-behind at the time of generation of the created links.

It would involve a bit more creative thought in the way you manage the links and may involve some variable placeholders within the code of the page itself (as opposed to the code-behind) but you should be able to get a generally working process going by using something like:

<a href="<%= urlVariableHere %>">

or similar. In this way you can set the required variable on the URL to match the values generated in your dynamic links.

That's just a first approximation thought on how to do it though.

Edit: Easy way to do this is to set up some Visible=false <asp:Label> on the page with their text components set to contain the generated URLs and use their labelName.Text property to populate the variable in the static URLs

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Nick,

Generally the installer for VS2010 will detect and upgrade all components as required in the conversion from 2005.

However...

If your local development machine is also running MS SQL Server 2005 and the install includes an upgrade to MS SQL Server 2008 you may run into some issues there. If MS SQL Server is actively running at the time of installation the install may fail and there is the slight possibility of damage to the MS SQL Server 2005 install.

If, on the other hand, your install does not include any change to MS SQL Server then you should have a relatively smooth upgrade even if you're installing the 2008 server management tools and such (which I believe are reverse-compatible with 2005 Server).

As for changes to your projects and code... The first time a project is opened within an upgraded environment (2005 project opened in 2010) it will prompt you to update the project.

If you are planning on working on the project in both versions do NOT do this as it will be unreadable in 2005 afterwards without some lengthy and annoying file tinkering.

I'm not sure about MS SourceSafe but I would personally think that if it was integrated into 2005 it would likewise be in 2010.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Jesi,

Is the menu on the left side within the same frame/container as the other content or separated?

If it is separated you might be able to maintain the variables by declaring them outside of both containers and allowing access to them from either container. More or less setting them as global variables instead of local variables within the main container.

Without seeing actual coding references I wouldn't be able to be more specific in pinning down your issue at this point.

Hope this helps :) If it does, please mark as solved.

P.s.: this probably should have gone into the ASP.Net forum :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I can see the issue you are having with the alignment and I can sympathize. For some reason on my site I have issues where table cells don't maintain their widths outside of FireFox (ie: a 4 cell table where each cell is set to 25% will show as if it was a 2 cell table at 50% each if 2 of the cells are empty).

I wish I could provide a solution for you, perhaps if I can figure out my table issue it might help with your alignment issue :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

When you say you have access to it through Windows Explorer what sort of access are we talking about? FTP? Browser? Direct File System access?

If your company is requiring you to build an ASP.Net application for them their IT team should be providing you full access rights and methods to perform the setup as required.

Generally speaking, once set up, unless it was not set up to host websites/infranet sites you shouldn't REALLY need to make too many adjustments on the IIS side but you should at least be given permissions to manage virtual directory and DNS settings as required.

I would approach whoever is responsible for management of the web server with a list of your requirements such as:

  • ability to set up virtual directories
  • ability to manage DNS settings
  • ability to remotely connect to the server (FTP or direct via Visual Studio which would require FrontPage Extensions to be allowed on the server)
  • ability to manage IIS settings and update modules (if required to update to newer version of .Net in the event that the version on the server is older than your development environment)

They may be able to set up some of these things for you or they may simply set you up with permissions and tools to do it yourself. Keep in mind that any changes to IIS generally require a server restart and, as such, should be done outside regular business hours if there are other web-apps …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Please see my detailed response in your other (identical) thread and mark both as solved if it resolves your issue. :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... here goes...

Your connection is established on Page_Load() but never utilized and is left open at that point.

The only point where I see the connection being closed is at the end of Button1_Click.

If your SQL connection is not needed at Page_Load() to properly manage loading of page information then don't include it in Page_Load().
Your code:

public partial class registration : System.Web.UI.UserControl
{
    string gender;
    SqlCommand cmd = null;
    SqlConnection con = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        con = new SqlConnection("Server=.; database=nkm; user id=sa; pwd=karthavya");
        con.Open();
        cmd = new SqlCommand();
        cmd.Connection = con;

        int years = DateTime.Now.Year;

        int i = 1;
        while (i < 32)
        {
            ListItem L = new ListItem(i.ToString(), i.ToString());
            days.Items.Add(L);
            i++;
        }

        for (i = 1; i < 13; i++)
        {
            ListItem L = new ListItem(i.ToString(), i.ToString());
            month.Items.Add(L);

        }

        for (i = 1950; i <= years; i++)
        {
            ListItem L = new ListItem(i.ToString(), i.ToString());
            year.Items.Add(L);
        }


    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (RadioButton1.Checked)
            gender = "Male";
        else if (RadioButton2.Checked)
            gender = "Female";

        cmd.CommandText = string.Format("SELECT uid FROM member WHERE uid='{0}'", txtuserid.Text);
        SqlDataReader buffer = cmd.ExecuteReader();
        if (buffer.Read())
        {
            Response.Write("<script> alert('User Id already exist " + buffer.GetValue(1).ToString() + " ...') </script>");
            buffer.Close();
        }
        else
        {
            cmd.CommandText = "member_login";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@uid", txtuserid.Text);
            cmd.Parameters.AddWithValue("@password", txtpassword.Text);
            cmd.Parameters.AddWithValue("@name", txtname.Text);
            cmd.Parameters.AddWithValue("@fname", txtfname.Text);
            cmd.Parameters.AddWithValue("@gender", gender);
            cmd.Parameters.AddWithValue("@dob", string.Concat(month.SelectedItem.Value, "/", days.SelectedItem.Value, "/", year.SelectedItem.Value));
            cmd.Parameters.AddWithValue("@bgroup", bgroup.SelectedItem.Value);
            cmd.Parameters.AddWithValue("@address1", txtaddress1.Text);
            cmd.Parameters.AddWithValue("@address2", txtaddress2.Text);
            cmd.Parameters.AddWithValue("@city", txtcity.Text);
            cmd.Parameters.AddWithValue("@district", txtdistrict.Text);
            cmd.Parameters.AddWithValue("@state", txtstate.Text);
            cmd.Parameters.AddWithValue("@pincode", txtpincode.Text);
            cmd.Parameters.AddWithValue("@email", txtemail.Text);
            cmd.Parameters.AddWithValue("@phone", txtphone.Text); …
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ah, well that makes a lot more sense now hehe.

Anywho, glad you solved it, should still mark the thread as solved to keep people from thinking it's an active thread going forward from here.

3:21am = goodnight! :D

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well for starters I believe you'll find hands down that managed code runs a higher overhead on system resources which is, in part, why it hasn't particularly 'taken off' in mainstream usage for software design* yet.

Coupled with the fact that (unless you force your memory management which defeats part of the purpose there) you have no control over exactly when a resource will be freed up it can cause some bulky memory loads in between disposals.

As for actual benchmarks, not really sure where to look per-se but I hope this helps put it in a bit better perspective.

Edit: * Let me qualify more specifically, C# (aka managed code) has become a widely used standard in ASP.Net based web applications but has not become a mainstream reality in desktop applications as of yet.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

What, if any, errors are you getting back when you attempt to run the code? This would definitely help pinpoint the cause of the problem.

Alternately, what results are you getting and what results are you expecting?

And didn't I just reply to another question about how to take a radiobutton variable and put it into an Access Database? Seems like you're everywhere I turn tonight... stop following me!! ((sorry, it's late, really bad sense of humor mode activated))