Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, loop problem :twisted:

Personally I like to do my loops like so:

Label1.Text = "";
for (int a = 0; a < ListBox1.Items.Count; a++)
{
    if (ListBox1.Items[a].Selected == true)
    {
        Label1.Text += " " + ListBox1.Items[a].Value;
    }
}

I think that might solve your issue. The way your code is written it's taking the "selectedvalue" which I think is basically equating to the most recent or top selected value only and not "all selected values" when writing output.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Question: Do you have a method in place to clear the textBox between button clicks?
Question 2: Are you trying multi-selections after trying single selections?

I generally would include a Label1.Text = ""; line prior to populating the Label1.Text (prior to the ForEach statement) to ensure that there are no previously entered values already present in the label prior to being filled with 'new' data.

Unless you have listbox items with identical values the only thing I can think of is that you're adding your list of selected items to an already present single selection.

Hope this helps :) Please remember to mark the thread solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, Umm... If you have SQL Server Management Tools available for you for the DB you're working on do this:

  1. choose the Date_Registered column within your table
  2. Column Properties > General > Default Value or Binding
  3. Enter "getDate()" (without quotes)

It may give you some grief over the fact that prior fields may or may not be already filled in but it will achieve what was suggested by mono.

Alternately, as this is now several days old and it's still not doing what you wanted it to do why not just give up on that if you can't figure it out and instead have the date generated on the application side and inserted at the time of the record being sent like I originally said :)

Either works, mono's method works behind the scenes and without fuss but you seem to be having difficulty implementing it.

See, this is what happens when I buy a new game and take a few days off DaniWeb :twisted:

AngelicOne commented: nice comeback.. xP +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Keeping in mind that my Red Bull function appears to require a higher value of sleep than I've input... (I've had 2 hours sleep so I'm a bit groggy)...

Might I ask where you're setting your classes up for your win-app? Are you doing so in the program.cs or the formNameHere.cs file?

int alertness = RedBull(sleep, ml)

public int RedBull(int sleepHours, int canSize)
{
    int alertness = 0; //Range 1-10
    if (sleepHours < 5)
    {
        alertness = 1;
        return alertness;
    }
    else
    {
        //insert crazy complicated calculation based on sleehours and canSize
        //return alertness more appropriate to answering questions
    }
}
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Hmmmm, ok, I thought the idea behind a static class (remember, I'm still learning) was; you don't have to instance it, and that you shouldn't.

No, you and farooqaaa are right, this would be a prime example of my brain going into 'standby' mode right in the middle of my Red Bull cycle :P

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

My bad, but the fact remains that as you stated:
>>You can't call class members without making an instance of it.

My methodology may be a bit off having been kept awake all night last night :zzz:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

You never instantiate AppUtils.

You wrote the class for it but never actually create an instance of the class as such:

AppUtils myUtils = new AppUtils();

All class objects need to be instanciated prior to use.

Your usage would then be:

aName = myUtils.myDogs[x].Name;

Hope that helps :) Please remember to mark the thread solved once your issue is resolved.

Edit: Disregard this, Lusiphur's Red Bull cycle hadn't completed yet and his brain hit 'standby' mode... Was thinking regular (not static) classes when I typed this :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If you no longer have a Default2 file then simply change

<%@ page language="C#" autoeventwireup="true" inherits="Default2, App_Web_caknetlg" %>

to this

<%@ page language="C#" autoeventwireup="true" %>

Particularly as the compiler is saying it can't find 'App_Web_caknetlg' either.

For future reference, please name your threads accordingly. Not every simgle thread that you write needs to be named "asp.net" as that tells us nothing about your specific problem.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Here you go...

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... first off... this same question was already answered for you at least once in the past.

Secondly, this same question was already answered for you at least once in the past......

I could list out the 4-5 times you've posted this same question but in the end it boils down to the fact that you have junk in your web.config files that is not compatible with the server settings that are on your web server and you need to eliminate all but the items that are compatible.

There is really no need to keep asking the same question over and over again because you're just going to get the same answer over and over again.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Really, it's not a horrible thing to post your code here, just take whatever error you're receiving and type it here (an error message with no code is better than no error message and no code) and if possible paste any relevant code segments that are even remotely related to the error in question encased in the [ code] blocks.

This gives others who are trying to help you more information to work with and a better chance of pinpointing your issue.

Stating that you are "facing a problem with one of your class" doesn't really give anyone any information to solve the problem and asking them to email you outside of the forum goes against the rules which state that things should be kept "on the site."

So don't be afraid to toss large code chunks at us as long as you also toss the error message(s) you're receiving along with them so people can actually help you out :) It's not like others haven't thrown page long code snippets at DaniWeb before.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I mean seriously... Especially when it was ME who was right first :'(

LoL Sorry, had to say it Ryshad. And I agree completely with what you said but um... now you and I are both guilty of refreshing the thread to point out that the thread didn't need to be refreshed :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Spoons don't make people fat. Swimming suits don't drown people. And guns don't kill people. It's a tool, just like a hammer or tractor or garbage disposal. You don't misuse those tools, and most people don't misuse firearms.

And my only question for you is this... If most people don't misuse firearms then why have them in the first place as there appears to be no valid use for firearms in today's society.

Keep in mind that by firearms I refer primarily to those not being used for 'sport' (aka hunting or firing range or marksmanship). If the average person who owns a gun and totes it around on their hip would never misuse it... and the average person who owns a gun and totes it around on their hip is fairly unlikely (as is an unarmed person) to be mugged tomorrow, or run into an invading army, or have their government turn on them... then what, specifically is a 'valid use' of having the gun on their hip such that it's use would constitute a need to carry it in the first place?

You speak of there not being a 'Wild West' mentality involved but let's be honest, the ready presence of a gun at close hand increases the likelihood of firearms related violence (self defence or otherwise) merely due to it's proximity. Granted, there are only a small subset of states within the USA that are to the extreme that you would generally see average citizens …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Why certainly!!

As gained from here:

<SCRIPT LANGUAGE="JavaScript">
      <!--
      document.write("The current URL is : "+location.href)
      // -->
</SCRIPT>

You will need to modify it a bit to match the input you want for your 404 but that snippet will get you the URL of the current page the user is on.

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well, if "cmd.Parameters.AddWithValue("opid", textBox1.Text);" is uncommented then from what I'm seeing it serves no purpose as you use

SqlCommand cmd = new SqlCommand("update outpatient set nm = @nm, addr =@addr,phno = @phno, mobno = @mobno,problem =@problem,docid =@docid,docnm =@docnm,spea = @spea,app = @app, age =@age,dt = @dt,ti = @ti where opid=" + textBox1.Text.ToString() + "", cn);

However right there you have a problem because what it should be is

SqlCommand cmd = new SqlCommand("update outpatient set nm = @nm, addr =@addr,phno = @phno, mobno = @mobno,problem =@problem,docid =@docid,docnm =@docnm,spea = @spea,app = @app, age =@age,dt = @dt,ti = @ti where opid='" + textBox1.Text.ToString() + "'", cn);

Realistically you could get away with eliminating the entire line

cmd.Parameters.AddWithValue("opid", textBox1.Text);

as it is not used in your UPDATE string.

The lack of single quotes around your inserted textbox value is where you are receiving a SQL error for an invalid input because it's trying to say "WHERE opid=value" and it should be saying "WHERE opid='value'".

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I'm confused, are you wanting to record the date of the registration within the information you're recording about the registration? Or in a separate record/table?

If you simply want the current date/time within the same record it's as simple as adding a date/time column in your table and populating it either from the code-behind side with DateTime.Now or on the SQL side with (I think) dateTime.Now() (been a while since I used the commands directly within SQL).

AngelicOne commented: thanks +1
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Short version, you have a form text field that is trying to pass script directly via your code-behind.

Example:
TextBox contains <a href="http://yourURL.com/">
TextBox contains <script="scriptHere">

Some server configurations prevent passing scripts from forms via code-behind as a security precaution.

Option 1: Disable this security precaution ("<%@ Page EnableEventValidation="true" %> in a page") Not a good option as it opens up many security holes in your application/site
Option 2: Provide alternate text modification methods (such as [ B][ /B]) that are handled at the code-behind level to convert the text to html equivalents so that html code is not being passed from the textbox/source and disable (possibly via RegEx) script from being entered into your textbox/source. Difficult (but not impossible) to code
Option 3: "use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation" simpler to code but still opens possible security issues in your code/site if not handled correctly

Hope this helps :) Please remember to mark solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

pipped at the post...great minds and all that :p

Haha no doubt :twisted: if not for minor format variations I'd swear we were reading each other's minds when we wrote those.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

1) Please use (code) tags to enclose your code segments as it makes them much easier to read :)
2) Judging by "ConfigurationManager.ConnectionStrings" this should be in ASP.Net

Now then...

You can approach it one of two ways...

Change your code to reflect this:

if (reader.HasRows)
{
    reader.Close();

    this.gvwregioncategory.DataSource = cmd.ExecuteReader();

    this.gvwregioncategory.DataBind();
}

or to this:

if (reader.HasRows)
{

    this.gvwregioncategory.DataSource = reader;

    this.gvwregioncategory.DataBind();
}

The way you have it currently = cmd.ExecuteReader(); occurs both outside and inside your try/catch/finally segment effectively opening the reader twice causing your error.

Hope that helps :) Please remember to mark the thread solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

DataSet

C# (as with most languages) is case sensitive :twisted:

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Defined session states (or equivalents) can add more direct control on the part of the coding that you implement but are not necessary for most day-to-day implementations of ASP.Net per-se.

Beyond that, I'll leave it to others more expert than I am to offer opinions on the importance (or lack of) of session state control and any scenarios where it might be more important than others.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

This would be one of those "yes... and no" type situations.

Yes, each person accessing the site would basically get their own 'session' in their interactions with the site. However... (and that's a strong word, however)... This is in large part affected by the methods and practices used in developing your code-behind components.

At the basic level, variables and passed information will relate to the session of the person who initiated them unless programmed otherwise. However, without specifically taking session states into account there are areas where this can go wrong and potentially cross populate information if mis-coded.

Hope that helps :) Please remember to mark as solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

When a user uses their browser's built in "bookmark page" or "add bookmark" button it is hard coded into the browser that it will default to the URL of the page they are on when they choose this option.

While the user can manually change the URL at this time (or by going into their bookmarks and editing them) I have never come across any in-page functionality that will tell this function to use any URL other than the one the browser is currently visiting.

The only option that I might recommend with regards to keeping your users 'in-the-loop' as it were is to either include them in some form of mailing list so they can be notified when/if the addresses for your site change or... maintain any 'defunct' domains for a set period of time with a redirect page explaining the change in order to catch at least your 'regular visitors'.

If you do have a button that will bookmark a more persistant path for your site then I encourage you to make it as noticeable as possible and explain the reasoning for it to encourage users to utilize it and avoid any issue :)

Hope that helps :) Please remember to mark solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Just going to throw this out there but...

IE, any version of IE, doesn't like it when you stack CSS definitions (more than 1 value per definition) as this is a CSS3 ability which is only voluntarily included in most of the 'good' browsers and completely omitted by the rest (particularly MS who seems to be loathe to include anything in their browser architecture until it's a "standard" that must be followed).

My thoughts on this...
Problem 1: "<body class="home page page-id-21 page-template page-template-default">"
Problem 2: "<div class="skip-link screen-reader-text">"
and so on...

That being said, I'm no CSS expert but whenever I get extreme performance variation between IE and FF I look there first and after spending 5 minutes wading through your CSS stylesheet I got lost and decided it was time for a smoke :twisted:

Hope this helps somewhat :) Please remember to mark as solved once the issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well, if we assume each character is a byte (generally) then you can use tbText.Text.Length to get the total number of characters (bytes) contained in the text segment you're working with and convert from there.

Hope that helps :) Please remember to mark solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I think I should add code behind the "Done" button on frmLocations that will refresh the combo box on the MainForm.

I think you're on the correct path with this theory :)

Basically, what you need to do is isolate the code that you're using to populate your comboBox in the first place into a code-behind procedure and include a Clear() style statement at the top of the population. Then when you use your "done" button on the other form it needs to call to the population procedure.

Basically by doing this, every time the combo-box is populated it first clears old values and then populates the current values from the table. When called from the "done" button it will do the same, repopulating the box with the updated info.

The Clear() statement should be something like comboBox1.Items.Clear() or similar (I haven't opened my VS C# yet today so can't be 100% sure there).

Hope that helps :) Please remember to mark the thread solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

What you're looking for is a Modal form.

This is something that comes up often enough around here so here's a link to a previous thread where a modal dialogue was discussed (please don't post in the old form though, if you have questions about what is discussed there please post them here).

That would suit the needs as you've stated them.

Hope it helps :) Please remember to mark this thread solved once your issue is resolved.

Geekitygeek commented: exactly right :) +1
ddanbe commented: Yes! +7
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

They've got a point AngelicOne and to be honest between nick.crane and Ryshad you've got 2 of the better helpers/posters in this sub-forum helping you which is why I stepped out of this one :twisted: I'd be heedin' their advice if I were you :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As Rogachev says you are not setting the proper value when passing your date information to the DB.

Your code of:

cmd.Parameters.AddWithValue("dt", textBox11.Text);

is passing a text value as if it were a dateTime value. As long as the textbox is correctly formatted (ie: all the dateTime components in the correct order) you should be able to correct this by changing it to this:

cmd.Parameters.AddWithValue("dt", Convert.ToDateTime(textBox11.Text));

Alternately, you can also follow Rogachev's solution as it only adds 1 line of code to your solution and would be entered as:

cmd.Parameters.Add("@dt", SqlDbType.DateTime);
cmd.Parameters["@dt"].Value = Convert.ToDateTime(textbox11.Text);

Hope that helps :) Please remember to mark as solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If pc2 is set up as a SQL server then most likely the sql server component can be accessed directly via the IP of that computer (depending on the network setup and the SQL setup. However, your scenario is very confusing to me.

You indicate your pc1 is your "server" but you indicate that pc2 has your SQL server...

What, exactly, is pc1 serving? And if it requires the SQL server setup on pc2 why not make pc2 your "server" and connect 1 and 3 to it that way?

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

By the way, as indicated here you can use the following method to read the MDF file without attaching it to your installed SQL Server:

Data Source='.\SQLExpress'; Initial Catalog=; Integrated Security=true; AttachDBFileName='...\Db.mdf'

Where your path in Data Source matches the installation path (generally a default path) for SQLExpress and the path in AttachDBFileName matches the installed location of your mdf file at time of your program being run.

Of course you need to ensure that other details are a match to your particular DB file like the catalogue and such.

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

If you have any knowledge of ASP.Net coding at all you might look into having different tables in different <asp:panel> and simply making the appropriate panel(s) visible/invisible as needed based on combination of drop-down and button click.

However, this does require a bit of coding knowledge in ASP.Net and a web-server capable of supporting .Net applications.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

To start this line is redundant:

c = System.Convert.ToInt32(Console.ReadLine());

As it has no bearing on the result of the codeand prompts an extra readline.

Secondly, as you already have:

using System;

You don't need to preface everything with System.

Third, prior to the end of your Main procedure you have an extra pair of braces that have no purpose and can be removed.

How I would have written it is as follows (however, I'm getting a nasty little glitch which I've seen before and can't explain where it doubles up the 2 input requests and only accepts the 2nd input):

static void Main(string[] args)
        {
            string name;
            Console.WriteLine("What is your name:");
            name = System.Console.ReadLine();
            Console.WriteLine("the name is " + name + "!!!!!!");
            Console.Read();
            Console.Clear();
            Console.WriteLine("wait there's more! ");
            Console.Read();
            Console.WriteLine("Simple Test ");
            Console.Read();
            Console.Clear();

            string a = "";
            string b = "";
            int c = 0;
            Console.WriteLine("Give me your first input: ");
            a = Console.ReadLine();
            System.Console.WriteLine("Give me your Second input: ");
            b = Console.ReadLine();
            c = Convert.ToInt16(a) + Convert.ToInt16(b);

            Console.WriteLine("ang sagot sa " + a + "at saka sa " + b + "ay...." + c.ToString() + "!!");
            Console.Read();
        }

For some reason the compiler is reading the whole segment for the first and second input together and only accepting input towards 'b' but I'm sure that's a glitch in the compiler and not related to the code as there's no logical reason for it from what I can see :twisted:

What I …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Couple of reference points related to this topic:

Now I could be wrong here but it looks more and more likely that even though you are able to detatch and distribute your mdf file with your application it will still only be able to read the mdf if sql server (express, or whichever) is on your target machine as well. At least one of the above links does have a connection string sample of connecting to a local mdf file however.

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

One method for changing the column header is to change the name of the column as it's pulled from the DB with the "AS" modifier.

As for the width it can be dynamically set with the equivalent of:

dataGridView1.Columns[0].Width

Hope that helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Well that's not quite what I meant by ratio but...

If your width was 800 and you increase it by 200 then your new ratio is 10:8 of the original or 5:4 <--> (800+200):800.

Edit: That's an increase of 1.25x the original image if you don't like the 5:4 way :twisted:

Hope that helps :) Don't forget to mark solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

I can't attest to whether there's anything that ASP.Net can do that php can't... What I can say is that for web development ASP.Net is a very powerful language with a lot of built in functionality.

If your focus is web development, it never hurts to have more languages under your belt and more and more companies are looking for people who have ASP.Net skills.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Unfortunately I don't have a sample script on-hand to provide you right this moment but...

1) you have no action defined... this would generally be where the form calls either a server side or client side script to process the submitted information and perform the tasks you require of it. Currently, from what I can tell, it'll just perform a page postback with no action.
2) you can utilize (in most cases) your web-server's built in mail functionality (with the use of a script as outlined above) to deliver the mail while simultaneously providing the on-screen feedback result you're looking for. There are a number of pre-written scripts in languages varying from javascript to php to server-side ASP.Net scripts but again I don't have any on-hand to provide you with at this time.

What I might recommend would be a quick google search for "form mail" scripts and see what you can find (unless someone else here feels up to writing or providing one for you).

Hope this helps somewhat :) Please remember to mark threads solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

More or less same thing applies, " can be written as '\"' or @'"' or if presented in it's alternate form @"&quot;".

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

You're too quick for me nick :P

I had just finished editing out that portion of my reply and as the page reloaded here was your reply about it :twisted:

Ah well, note to self, don't skim the forums here until the first half of the Red Bull has kicked in!

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

As nick indicated (but I'll expand on a bit) if you're trying to match the character '\' you need to write it as '\\'. This is because '\' is considered part of an escape sequence when identifying characters that are otherwise reserved for use within your coding.

For more information on escape sequences check here.

Hope this helps :) Please remember to mark as solved once your issue is resolved.

Edit: Darn you Ryshad you beat me to the edit :P was about to include the @"\'" option then saw your post haha

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

AngelicOne;

  1. What is the date/time format of the picker producing? (ie: what is the order of the date/time value)
  2. What error are you getting when you say it "doesn't work"

In theory the date/time generated by the picker should match an accepted date/time format in use by SQL server, however, if it doesn't then you would receive an error from SQL Server indicating an invalid date/time format. If this is the case then you need to change the format output of the picker to match an accepted format for date/time before submitting the result to the database.

Hope this helps :) Please remember to mark the thread solved once your issue is resolved.

Edit: removed portion of my reply that was a result of not enough caffeine and having just woken up :twisted:

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

:twisted: My method was more of a "theory-in-practice" method but ryshad's got the point of it and I like his method as more simplistic to implement.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster
string eventOccurrenceUrl = --determined at time of eventOccurrenceDrp population as first value in the dropdown--;

protected void eventOccurrenceDrp_SelectedIndexChanged(object sender, EventArgs e)
{
    eventOccurrenceUrl = eventOccurrenceDrp.SelectedValue;
}

overLoadEventHyper.NavigateUrl = "~/SignupForAnEventOccurrence.aspx?eventAuid=" + Request.QueryString["eventAuid"] + "&eventOccurrencesAuid=" + eventOccurrenceURL;

I would leave it up to you to figure out where in your code each part of that needs to go but the concept is simple enough... at the time that eventOccurrenceDrp is populated the initial value of eventOccurrenceUrl is populated as well. Any time the drop down selection is changed it changes the string value to correspond.

Hope this helps :)

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

This reference might help. :twisted: Looks like it addresses exactly what you're asking for here with about 2 lines of code.

Hope this helps :) Please remember to mark this thread solved once your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Short answer, no...

Long answer, noooooooooooooooo :twisted:

Each calendar can select only one date (if you're using the default asp:calendar as indicated) though I'm sure there are some Spry or AJAX modules that you can install that will allow selection of ranges or multiples.

If you require multiple dates using the default calendar, however, you will require multiple inputs and multiple calendars.

Hope this helps :) Please mark the thread solved if your issue is resolved.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

You can always un-solve the thread if you want to continue the discussion :twisted:

On that note, I don't have an answer for you at the moment, sorry.

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Should be able to use this to do what you want...

string path;
   path = System.IO.Path.GetDirectoryName( 
      System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );

Got that from this source. There's also a VB method there as well.

Hope this helps :) Please mark as solved once your issue is resolved.

0xCMD commented: Thanks I'll try the suggestion and reply back. +0
Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok... Just as a note, I literally had to copy/paste your relevant code segments into 2 separate notepads side by side to check it over but here's what I'm seeing for starters:
Your 2 slideshow scripts (the portion that follows) are identical. If they will function as identical scripts there's no need to have them there twice

<script type="text/javascript">

for(var j = 0; j < imgAr1.length; j++)
{
		rImg1[j] = new Image();
            rImg1[j].src = imgAr1[j];
}

document.onload = setting();

var slide;
function setting()
{
	slide = document.getElementById('pic');
	slide.src = imgAr1[0];
	slide.setAttribute("width",width);
	slide.setAttribute("height",height);
}

//Image or picture slide show using java script
//slideshow function
var picture = 0;
function slideshow(){
	if(picture < imgAr1.length-1){
		picture=picture+1;
		slide.src = imgAr1[picture];
	}
}

function prev(){
	if(picture > 0 ){
		picture=picture-1;
		slide.src = imgAr1[picture];
	}
}

function start(){
		slide.src = imgAr1[0];
		picture = 0;
}

function end(){
		slide.src = imgAr1[imgAr1.length-1];
		picture = imgAr1.length-1
}
</script>

That being said, if they're meant to work on separate slideshow sets you may want to consider making them unique to each other by changing the variable name styles for things like the image libraries as currently the only point of variance is between

<a href = "javascript<b></b>:void(0)" onclick = "document.getElementById('sh').style.display='block';document.getElementById('fade').style.display='block'">

and

<a href = "javascript<b></b>:void(0)" onclick = "document.getElementById('ed').style.display='block';document.getElementById('fade').style.display='block'">

and in the image filenames themselves.

Now, my javascript is a bit on the rusty side but... from what I'm seeing of the code segment I showed above it looks as if your slideshow is basing from …

Lusiphur 185 Practically a Posting Shark Team Colleague Featured Poster

Ok, basically, what I'm finding when I look at print options for web applications is this...

1) It's not a code-behind process, it's a user-end process
2) It can be accomplished using JavaScript or other browser-level scripting

A simple method to invoke a 'print-screen' type scenario would be the JavaScript function of

window.print()

Which will call the page print function. Beyond that, if you want to add additional print functionality (page layout, etc) you would need to look into other JavaScript or possibly ActiveX controls of some sort to implement those functions.

Hope that helps :) Please remember to mark as solved once your issue is resolved.

P.s.: The above information was from the first non-advertising link in the search I posted to you earlier... Please try to perform basic research before asking others to do your work for you in the forums :twisted: