BMXDad 23 Newbie Poster
$("#DatePick").datepicker({
   minDate: <%= DateTime.Now.ToShortDateString() %>
}); 

This will set min date to the current date. Only future dates are available to select. Set the 'minDate' argument to the date you need.

BMXDad 23 Newbie Poster

Use jQuery

$("ul.nav > li a[href*='pageName']").parent("ul.nav > li").addClass("active");
BMXDad 23 Newbie Poster

Check your CSS classes, to make sure they are not floating it over or repostioning it somehow.

BMXDad 23 Newbie Poster

Try casting it to a string

Name.Text = (string)Request.QueryString("Name");

BMXDad 23 Newbie Poster

What do you mean crashed? What did the error say?

BMXDad 23 Newbie Poster

Yes, you can even point your custom domian to it. There are some restrictions if your site has alot of traffic, but not to bad.

BMXDad 23 Newbie Poster

oops, modded version :-)

    if (dat.Day == 11 || dat.Day == 12 || dat.Day == 13)
            {
                ord = "th"; 
            }
            else
            {
                switch (i)
                {
                    case 1:
                        ord = "st";
                        break;
                    case 2:
                        ord = "nd";
                        break;
                    case 3:
                        ord = "rd";
                        break;
                    default:
                        ord = "th";
                        break;
                }
            }
JorgeM commented: very nice! +12
BMXDad 23 Newbie Poster

Ah ... understand now. Your best bet would be to make a custom formatter. Here is one I've used. Stole the idea from someone awhile ago ... :-)

    public class FormatOrdinal : IFormatProvider, ICustomFormatter
    {
        public object GetFormat(Type fType)
        {
            if (fType == typeof(ICustomFormatter))
                return this;

            return null;
        }

        public string Format(string format, object obj, IFormatProvider formatProvider)
        {
            if (!(obj is DateTime)) throw new Exception();

            var dat = (DateTime)obj;

            string ord;

            switch (dat.Day % 10)
            {
                case 1:
                    ord = "st";
                    break;
                case 2:
                    ord = "nd";
                    break;
                case 3:
                    ord = "rd";
                    break;
                default:
                    ord = "th";
                    break;
            }

            return string.Format("{0:MMMM} {1}{2}, {0:yyyy}", obj, dat.Day, ord);
        }
    }
}

Use it like this ...

string.Format(new FormatOrdinal(), "{0}", SomeDate);

BMXDad 23 Newbie Poster

Couple things that may make life easier ...

  • Use ValidationGroup names. Then you can validate groups or individual inputs
  • Don't use inline SQL. Write a view or procedure to do the work, then call the procedure. Big security no no. Inline SQL opens you up to SQL injection.
  • For dates, use the RegEx validators and use the prebuilt expressions that are included. Much easier to work with.
  • Learn RegEx ... not hard for the basic stuff, and very powerful
  • Learn how to use Enterprise Manager. This will make your SQL calls super easy to code, and it's easy to setup and use.
BMXDad 23 Newbie Poster

... you can usually refresh by hitting F5.

BMXDad 23 Newbie Poster

You can't ... unless you have access to a pbx.

BMXDad 23 Newbie Poster

Your site host needs to be able to support IIS. Not all hosting sites do.

If they don't your either going to have to find a new host, serve it yourself or use a different language.

Azure is easy to use and free for a simple site.

BMXDad 23 Newbie Poster

Are you looking for a certain format?

This is what I do to keep the copyright set to the current year ...

<%= DateTime.Now.Year %>

If you need the whole date ...

<%= DateTime.Now.ToShortDateString %>

BMXDad 23 Newbie Poster

If your record count is fairly small you can use the .RecordCount attribute on the record set. Otherwise a seperate SQL statment returning an int of records counted.

BMXDad 23 Newbie Poster

Go into designer view, refresh and save the page, then go back into code view.

Sometimes the IDE is slow in writing to the .designer file.

BMXDad 23 Newbie Poster

Yes, call a stored procedure in the database that will list out the columns you want. Bind the results to the DataGrid.

BMXDad 23 Newbie Poster

Add font-awesome or one of the other icon stacks.
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

Example from Font-Awesome ( Font-Awesome ):

<div class="list-group">
  <a class="list-group-item" href="#"><i class="fa fa-home fa-fw"></i>&nbsp; Home</a>
  <a class="list-group-item" href="#"><i class="fa fa-book fa-fw"></i>&nbsp; Library</a>
  <a class="list-group-item" href="#"><i class="fa fa-pencil fa-fw"></i>&nbsp; Applications</a>
  <a class="list-group-item" href="#"><i class="fa fa-cog fa-fw"></i>&nbsp; Settings</a>
</div>
BMXDad 23 Newbie Poster

Make sure the path to your external files are correct. You can go to 'View Source' in the browser and click on an external file location. If it doesn't work, then you'll need to find out why.

Code example would help.

BMXDad 23 Newbie Poster

Looks like your trying to convert "monster.co.uk" to an int

BMXDad 23 Newbie Poster

Try to think of an interface as a class of classes. Each seperate class could be of a different type. It allows you to create very complex models.

BMXDad 23 Newbie Poster

Try removing the "http" on your links.

I.E. href="\somewebsite.com\css\site.css"

This is a hack that works if one of the sites is using https or http.

<M/> commented: Hmmm, never thought of that... +10
BMXDad 23 Newbie Poster

diafol ... nicely done.

I'd make a small change though (visual stuff):

    body{
        font-size: 60px;
    }
    .ring{
        color:white;
        text-align: center;
        background-color:#CC0000;
        padding: 5px;
    }
BMXDad 23 Newbie Poster

Do you have access to Sql Mail?

BMXDad 23 Newbie Poster

Doesn't look like your calling LoadGrid() till after a dropdown selection. On page load you can do this, but you'll need to have some default start values.

Also, firstDate and secondDate values are not set till a dropdown selection. You might want to refactor and call LoadGrid() by passing the needed parameters: LoadGrid(DateTime firstDate, DateTime secondDate). Then on page load you can call it with default values.

BMXDad 23 Newbie Poster

Your trying to turn a DataSet into a Table explicitly which might not work ... try this:

 public DataTable hrdoc1(int id)
{
    DataSet ds = (Call DataSet here)
    DataTable dt = ds.tables[0];
    return dt;
}
BMXDad 23 Newbie Poster

Wrap it in an if then clause, checking a date?, then have a seperate panel with a message on why its not available. How are you going to stop them from voting twice? Coookies can be deleted ... a login page would be the only way, but even that can bve side stepped if you don't verify the user.

BMXDad 23 Newbie Poster

Accessibility ... Can it be read and navigated by anyone?

User Experiance ... Can I find what I want fast. Can I view it on my ... (Phone, tablet, laptop, desktop).

Is the content relevent to what the site is about?

BMXDad 23 Newbie Poster

On the grids row databound event you can access and run your method that would fill the dropdown. You can even set selected item after its loaded, by using a hidden value in the gridview data.

BMXDad 23 Newbie Poster

Is this an MVC or Forms page?

BMXDad 23 Newbie Poster

Grab an id from a grid row and then use that to get the detail information. Works best if you can put the id into a link button CommandArgument.

Example below:

<asp:templatefield>
    <itemtemplate>
        <asp:LinkButton ID="imgbtnGetDetails" commandargument='<%# Eval("sID") %>' commandname="DetailRow" cssclass="imgIcon" runat="server" >
            Details
        </asp:LinkButton>
    </itemtemplate>
</asp:templatefield>
BMXDad 23 Newbie Poster

You need to check c1.SignUp, to see if the return value is true or false.

BMXDad 23 Newbie Poster

What is your procedure "GetMonthlyReport" bringing back?

BMXDad 23 Newbie Poster

Can you post the full Inner Exception text?

BMXDad 23 Newbie Poster

You need to clear the 2nd dropdown before loading it.

DropDownList2.Items.Clear()

BMXDad 23 Newbie Poster

Where is hrdoc1 called? Where is id set?

BMXDad 23 Newbie Poster

Because its an int, which defaults to 0.

BMXDad 23 Newbie Poster

Your code is going to fire as soon as the page is finished loading.

Try this, it works differently on IE and Firefox though:

$(window).bind('beforeunload', function() {
    alert("You are attempting to leave this page. Are you sure want to leave MSJ Bank Financial?");
});
BMXDad 23 Newbie Poster

What are the extra/doubled parameter fields?

BMXDad 23 Newbie Poster

Is there a click event on the button?

BMXDad 23 Newbie Poster

You might want to rethink your database design. A catagory list should be a table lookup, which in turn is referenced in a data table.

You have a database diagram you could show?

BMXDad 23 Newbie Poster

What error are you getting?

BMXDad 23 Newbie Poster

Change <asp:Checkbox ID = "chklst" runat="server" /> to
<asp:CheckBoxList ID="chklst" runat="server" AutoPostBack = "true"></asp:CheckBoxList>

To add to it, do this in your .cs file

chklst.Items.Add('Happy Birthday');
chklst.Items.Add('Happy Happy Birthday');

BMXDad 23 Newbie Poster

Try this:

private void RadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = e.Item as GridDataItem;
        string contactName = dataItem["SomeField"].Text;

        LinkButton button = dataItem["ColumnName"].Controls[0] as LinkButton;
        button.Attributes["onclick"] = "return confirm('Are you  Sure You Want to Delete User??')";
    }
}
BMXDad 23 Newbie Poster

Example page? Rest of code?

With the information given, its acting like the container its in has a set or max width.

BMXDad 23 Newbie Poster

Create a User class, and add it to a Session.

Session["User"] = Users.GetUser(1);
Then you can grab the Session["User"] to fill any info you need.

Users usr = (Users)Session["User"];

string pass = usr.Password;
string usrName = usr.UserName;

BMXDad 23 Newbie Poster
<!DOCTYPE html>
<html>
    <head>
        <title>Floating problem</title>
        <style type="text/css">
        .mainWrapper{
        background-color:red;
        max-width:630px;
        min-height:400px;
        padding:0;
        }
        .one{
        width:310px;
        height:120px;
        background-color:magenta;
        float:left;
        margin-bottom:10px;
        }
        .two{
        width:310px;
        height:120px;
        background-color:magenta;
        float:left;
        }
        .three, .four{
        width:310px;
        height:150px;
        background-color:yellow;
        float:left;
        }
        .three{
        margin-right:10px;
        }
        /* .subThree1{
        width:150px;
        height:150px;
        background-color:black;
        } */
        .one{
        margin-right:10px;
        }
        </style>
    </head>
    <body>
        <h2>Floating problem</h2>
        <div class="mainWrapper">
            <div class="one">
                <p>1</p>
            </div>
            <div class="two">
                <p>2</p>
            </div>
            <div class="three">
                <p>3</p>
            </div>
            <div class="four">
                <p>4</p>
            </div>
            <div style="clear:both;" />
        </div>
    </body>
</html>
BMXDad 23 Newbie Poster

About W3Schools ... I would not use.

Just saying ... http://www.w3fools.com/

BMXDad 23 Newbie Poster

Nothing wrong with using tables in a responsive site. Just make sure that word wrap is on. Some data by its nature is not able to be completly responsive though, and thats ok ...

Another option would be to put it in a horizontal form with labels. These would stack nicely if the viewport was to small.

BMXDad 23 Newbie Poster

Have you tried the jQuery Toggle

$('#< %= btnName.ClientID %>').click(function() {
    $('#DivId').slideToggle('slow');
});
BMXDad 23 Newbie Poster

Use a Session[] ...

Session["Name"] = null;
Session["Name"] = txtBox.Text.Trim();

then in the page that your printing with, use it like so ...

string sName = Session"Name"] != Null ? Session["Name"].ToString() : string.Empty;
lblName.Text = sName;