|
The content type has nothing to do with your database, it has to do with telling the browser how to display what it's been sent, so it doesn't have to try and work it out for itself.
Have you considered buying a book on ASP.NET and working through it ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, there Christ, I am working through a book. I taught myself to develop static website and thought its time to go interactive so I started learning ASP.NET using VB.net from a book I've borrowed from the library. The problem I have is when I get stuck I have no one to ask. Often times I don't understand some of the explanations given or the explanations are not given for some of them at all. For some reason some of the code that was given in the book does not compile and so I'm here asking questions. Unfortunately I don't have money to take a formal class. Hope you understand where I'm coming from.
|
|
|
|
|
OK - sounds like perhaps you have an ASP.NET 1.0 or 1.1 book, and you're using 2.0, that's the most likely reason for compilation issues.
I know what it is to not have much money, but buying a single ASP.NET 2.0 book is not a huge investment, and it would help you a whole lot. By all means, keep asking questions here, but I do think a good reference would go a long way to getting you started with this stuff.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have form with the more number of text boxes and one button to save the data to database. When the user clicks on the button I have to save the data in database. Here my question is if the user clicks the button then I am saving the database after with in one second he by mistake clicks the button again then we need to ask him there is no changes in the form do you want to save it ? How do we check whther form data is changed or not?
Thanks
|
|
|
|
|
Heres an easy solution:
When the user clicks the "Save" button disable the button (this will prevent double clicks"
Keep the button disabled until something on the form changes, ie; some text changes.
To do the second part, he is some pseudo-code to help you get started
Dim HasChanged as Boolean = False
Then in the TextChanged Event of your textboxes (you can have one that controls all the textboxes so you dont have multiple functions doing the same thing) change HasChanged to True
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged,TextBox2.TextChanged, etc...
HasChanged = True
If HasChanged Then
Button1.Enabled = True
Else
Button1.Enabled = False
End If
End Sub
Keep in mind this is just a "general" starting point, you'll have to do the rest, then if you run into problems post your code here (and the problem/error you're having) and someone will help
"It's only that urgent if you have to pee."
Dave Kreskowiak
|
|
|
|
|
Psycho-*Coder*-Extreme wrote: It's only that urgent if you have to pee."
Dave Kreskowiak
That is a funny one. I put it in my CPHog sig the day he said that. I generally save some of these for the Soapbox
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi,
Instead of a R,D want to change the format to "R", "D". I have tried embedding some formatting like
string = """ & "R" & """ & "," & _
""" & "D" & """
Thanks for your time.
|
|
|
|
|
You don't need to create the quotes seperately, you can build it all as one string. This is language specific question that has nothing to do with ASP.NET, it looks like this is VB, which means I don't know exactly how to do it, in C# you use \"
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
To add to what Chrstian said:
string = """R"",""D"""
|
|
|
|
|
Another option worth a look at, would be to use string.format. It might not be especially usefull for two charectors, but works well with medium to larger strings.
VB
Dim s As String = String.Format("{0}{1}{0}, {0}{2}{0}", """", "R", "D")
C#
string s = string.Format("{0}{1}{0}, {0}{2}{0}", "\"", "R", "D");
This first argument is the format of the string (between first set of quotes), then just supply the parameters that you made place holders for (in the example 3).
*Edit (Added C# example - sorry I work with VB more than C#)
-- modified at 21:44 Monday 23rd July, 2007
|
|
|
|
|
I was going to do a String.Format example, I guess you beat me to it
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Used Chr(34) which seemed to work as well.
Thanks for all the help.
|
|
|
|
|
That'll work just fine, as well.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hello All,
Thank you for reading this post. Iam trying to build a single sign on, so that other applications in my company can be reached by just logging once. Here is how it is:
1. Lets say the site i build is called abc.com
2. I want the user to logon to abc.com, all my user info is in a SQL Server database
3.Once login is determined successful, we go to a welcome page in abc.com... From abc.com, there is a link called link1.abc.com which is a different application... here i dont want the application to ask for logon credentials again, it should give access to the user because user was validated in abc.com
4. Expanding this...how to I provide this service if i have more that 3 applications...???
My company cannot afford LDAP...all we have is a good SQL Server database, .NET 2005...what is the quickest and best way to acheive single sign on ???
Sample code, articles explaining things are very very welcome !!
Thank you
RH
|
|
|
|
|
If you have a single SQL Server database, then I'd imagine what you need is a database in there of who is logged on, which is shared between applications.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
my button click event is not being fired. Asp.net 2.0
why is that?
|
|
|
|
|
Make sure UseSubmitBehavior is set to true and as well as cause validation is set to true....
|
|
|
|
|
i did. it still doesn't work. i tried a link button instead. that doesn't work either.
however, if i am in debug mode both events work.
|
|
|
|
|
Oh, Have you check your AutoEventWireup property...
AutoEventWireup=true
|
|
|
|
|
i don't see that property
|
|
|
|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RepeaterFormControl.aspx.cs" Inherits="RepeaterFormControl" %>
This is one of the page attribue. I don;t know how have set your event delegates. So try with true and also fith false......
All the best...
|
|
|
|
|
When an user clicks on a button click event and after the event got executed, if he hits on F5 key or Refresh button, the same button click event executes once again. How i can avoid this in ASP.Net 2.0.?
Moreover i clear all the controls, so that it should fire javascript for mandatory fields. Instread of that it is rerading the values from cache.....
I tried Button, HTML Submit and as well as ImageButton....But same behaviour....
Source Code:
public partial class RepeaterFormControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
GetDataFromDatabase();
if (!(IsPostBack))
{
Button1.Attributes.Add("onclick", "return ValidateInput();");
}
}
private void GetDataFromDatabase()
{
SQLDataAccessHelper daHelper = new SQLDataAccessHelper();
this.Repeater1.DataSource=daHelper.ExecuteReader(CommandType.StoredProcedure, "GetFormViewData");
this.Repeater1.DataBind();
}
protected void clearControls()
{
((TextBox)(FormView1.FindControl("TxtFName"))).Text = "";
((TextBox)(FormView1.FindControl("TxtLName"))).Text = "";
((TextBox)(FormView1.FindControl("TxtEmail"))).Text = "";
((TextBox)(FormView1.FindControl("TxtDob"))).Text = "";
}
protected void btnSave_Click(object sender, ImageClickEventArgs e)
{
String sFname = ((TextBox)(FormView1.FindControl("TxtFName"))).Text.ToString();
String sLname = ((TextBox)(FormView1.FindControl("TxtLName"))).Text.ToString();
String sEmail = ((TextBox)(FormView1.FindControl("TxtEmail"))).Text.ToString();
string sDOB = ((TextBox)(FormView1.FindControl("TxtDob"))).Text.ToString();
String sCountry = ((DropDownList)(FormView1.FindControl("CmbCountry"))).SelectedItem.Text.ToString();
SQLDataAccessHelper daHelper = new SQLDataAccessHelper();
IDataParameter[] objparam;
objparam = daHelper.GetSpParameterSet("AddFormViewData");
objparam[0].Value = sFname;
objparam[1].Value = sLname;
objparam[2].Value = sEmail;
objparam[3].Value = sDOB;
objparam[4].Value = sCountry;
daHelper.ExecuteNonQuery("AddFormViewData", objparam);
GetDataFromDatabase();
clearControls();
sFname = "";
sLname = "";
sEmail = "";
sDOB = "";
}
}
And ASPX code....
<asp:imagebutton id="btnSave" runat="server" ImageUrl="Images/btnsave.gif" tabIndex="10" Width="82px" OnClick="btnSave_Click"></asp:imagebutton>
Thanks
Amit
-- modified at 14:43 Monday 23rd July, 2007
|
|
|
|
|
Here is the reply
http://aspalliance.com/articleViewer.aspx?aId=687&pId=-1
Thanks!!
|
|
|
|
|
Hi all?
Can IIS 7.0 be installed on windows vista?
Is there an option called Windows authentication on IIS 7.0?
Regards
|
|
|
|
|
Stop cross posting and you may get a reply.
only two letters away from being an asset
|
|
|
|