|
|
You want us to write your code for you, without you trying, based on this vague description ? There's a job board on this site, you can find someone there you can pay to do your work for you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I Can't Use ASPxGridView Delete Button (for Developer Express).
Please help me?
|
|
|
|
|
zizigolo110 wrote: I Can't Use ASPxGridView Delete Button (for Developer Express).
How can we help you because we don't know where you are going wrong and what you are doing to use that button.
Search in google how to use gridview delete button. you will get more example and tutorial.
regard
Imrankhan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi I am using AjaxControlToolkit AutocompleteExtender control.I am using it to search email Ids delimited by comma.
It's default behavior is like this :
Say I typed a.............it returns say abc@hotmail.com
axd@gmail.com......and so on
Now say after selecting an email id(say abc@hotmail.com) I put a comma and search for another Id..say I type b.........it returns abc@hotmail.com,bmw@gmail.com
abc@hotmail.com,bcr@yahoo.com
abc@hotmail.com,brd@rediffmail.com ....and so on.
INSTEAD I WANT IT LIKE,
bmw@gmail.com
bcr@yahoo.com
brd@rediffmail.com....and so on.
I meant to say the new search result is appended with the whole Target TextBox's value.But I want search result for newly typed character only.
I hope I could make you understand my problem.I just want to extend the AutoCompleteExtender control of AjaxControlToolkit.....but how?????????I have no idea.
I searched a lot for this problem..but the solutions I got is applicable for Atlas...not for AjaxControlToolkit.
Can anyone get me the solution?
Thanks and Regards..
CC26
|
|
|
|
|
Can't anybody help????
CC26
|
|
|
|
|
I have attached the code in aspx.
<br />
<br />
<table><br />
<tr><br />
<td style="width: 100px; height: 26px"><br />
<asp:Label ID="Label2" runat="server" Text="Username:"></asp:Label></td><br />
<td style="width: 154px; height: 26px"><br />
<asp:TextBox ID="usernameTB" runat="server" Width="140px" OnTextChanged="usernameTB_TextChanged1"></asp:TextBox><br />
</td><br />
</tr><br />
<tr><br />
<td style="width: 100px"><br />
<asp:Label ID="Label3" runat="server" Text="Password:"></asp:Label></td><br />
<td style="width: 154px"><br />
<asp:TextBox ID="passwordTB" runat="server" OnTextChanged="passwordTB_TextChanged"></asp:TextBox></td><br />
</tr><br />
<tr><br />
<td style="width: 100px; height: 16px"><br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td><br />
<td style="width: 154px; height: 16px"><br />
<asp:Button ID="btnlogin" runat="server" Height="24px" OnClick="btnlogin_Click" Text="Login"<br />
Width="70px" /><br />
<asp:Button ID="btnlogout" runat="server" OnClick="btnlogout_Click" Text="Logout" /></td><br />
This is the code for aspx.cs
<br />
protected void btnlogin_Click(object sender, EventArgs e)<br />
{<br />
if (usernameTB.Text != "")<br />
{<br />
<br />
if (passwordTB.Text != "")<br />
{<br />
OleDbConnection mdb = new OleDbConnection();<br />
OleDbCommand cmd;<br />
OleDbDataReader rdr;<br />
Connect.DBConnection(mdb);<br />
mdb.Open();<br />
string SQLinfo = "SELECT * FROM Customers WHERE cUserName = '" +<br />
usernameTB.Text.ToUpper() + "'";<br />
{<br />
if (passwordTB.Text == (string)rdr["cPassword"])<br />
else<br />
{<br />
rdr.Close();<br />
mdb.Close();<br />
usernameTB.Text = "";<br />
passwordTB.Text = "";<br />
Response.Write("<script>alert('Error signing in')</script>");<br />
break;<br />
|
|
|
|
|
This code is really awful for a number of reasons, I assume it's just for learning purposes ?
You're saying that all your references to usernameTB does not exist, or passwordTB does not exist ? Does it compile ? When do you get the error, and for what lines ?
Is your aspx code inside the form tag ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for reply. Thanks for saying the code is aweful.
I want to link up data with my database. Exmaple: when user input their password & username. It will generated a check whether the data inputed is it same as the database.
|
|
|
|
|
Kristy Chan wrote: Thanks for saying the code is aweful.
SQL in the presentation layer is always bad, and so is your method of checking a username/password. Very insecure.
You didn't answer me - where is the error ? Does the code compile ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
here is the code for asps.cs
sing System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class _Default : System.Web.UI.Page
{
DBConnect Connect = new DBConnect();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnlogin_Click(object sender, EventArgs e)
{
if (usernameTB.Text != "")
{
if (passwordTB.Text != "")
{
OleDbConnection mdb = new OleDbConnection();
OleDbCommand cmd;
OleDbDataReader rdr;
Connect.DBConnection(mdb);
mdb.Open();
string SQLinfo = "SELECT * FROM Customers WHERE cUserName = '" +
usernameTB.Text.ToUpper() + "'";
string SQLlog = "INSERT INTO Log (lName,lLogIn) " +
"VALUES (@UserName, @Date)";
cmd = new OleDbCommand(SQLinfo, mdb);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
if (passwordTB.Text == (string)rdr["cPassword"])
{
Session["sName"] = rdr["cName"];
Session["sUserName"] = rdr["cUserName"];
Session["sAddress"] = rdr["cCoAddress"];
Session["sCoContact"] = rdr["cCoContact"];
Session["sPIC"] = rdr["cPersonInCharge"];
Session["sPICContact"] = rdr["cPICContact"];
Session["sEmail"] = rdr["cEmail"];
Session["sFlag"] = "T";
rdr.Close();
cmd = new OleDbCommand(SQLlog, mdb);
cmd.Parameters.Add("@UserName", OleDbType.Char).Value = (string)Session["cUserName"];
cmd.Parameters.Add("@Date", OleDbType.Date).Value = DateTime.Now;
cmd.ExecuteNonQuery();
mdb.Close();
break;
}
else
{
rdr.Close();
mdb.Close();
usernameTB.Text = "";
passwordTB.Text = "";
Response.Write("<script>alert('Error signing in')</script>");
break;
}
}
mdb.Close();
}
}
}
protected void btnlogout_Click(object sender, EventArgs e)
{
OleDbConnection mdb = new OleDbConnection();
OleDbCommand cmd;
Connect.DBConnection(mdb);
string SQLlog = "UPDATE Log SET lLogOut = @Date WHERE lName = @Name";
cmd = new OleDbCommand(SQLlog, mdb);
cmd.Parameters.Add("@Date", OleDbType.Date).Value = DateTime.Now;
cmd.Parameters.Add("@Name", OleDbType.Char).Value = (string)Session["cUserName"];
mdb.Open();
cmd.ExecuteNonQuery();
mdb.Close();
}
There are 6 errors:
Error 1 The name 'usernameTB' does not exist in the current context(line 25)
Error 2 The name 'passwordTB' does not exist in the current context(line 28)
Other errors shown in line 36,43,65,66
Thanks
|
|
|
|
|
What is the point of the DBConnect class ? I ( again ) assume no-one is paying for this code ?
My other question - does the stuff in the aspx occur within the form tag ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Okay. I deleted the DBConnect Connect = new DBConnect();
but it occured another error
" The name Connect does not exist in current context. (line 33 and 80)
It occured within the form tag.
|
|
|
|
|
Well, you use it in your code, I didn't say you need to delete it, I can see you're using it. I just asked where it comes from, because it seems kind of odd to me.
Perhaps you need to post all your aspx code, that's plainly where the error is.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
aspx code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body style="font-size: 12pt" background="wedding.jpg">
<form id="form1" runat="server">
<div>
<span style="font-size: 16pt">Reservation System <br />
<asp:Image ID="Image1" runat="server" ImageUrl="~/logo.jpg" />
<asp:Image ID="Image2" runat="server" ImageUrl="~/2.jpg" Height="181px" Width="175px" /><br />
<br />
Existing Customer
<br />
<br />
</span>
</div>
<table>
<tr>
<td style="width: 100px; height: 26px">
<asp:Label ID="Label2" runat="server" Text="Username:"></asp:Label></td>
<td style="width: 154px; height: 26px">
<asp:TextBox ID="usernameTB" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
|
|
|
|
|
If the rest of this closes at the bottom properly, then I'm not sure what the issue is. Try creating a brand new page, and then adding the controls and referencing them in code, then build the page a bit at a time and see if you can get it to work then, or if it breaks. That way, you can work out which part is breaking it, because it seems OK to me.
Is this homework ? You've dodged this question all along. It looks about the sort of poor standard I'd expect from an Indian outsourcing firm, but if that's what you are, you don't seem to be interested at all in my comments about how bad the code is and how it could be made better ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
oh. I am not in India. I am still a student whose in not good in programming. Since, you have raised up regarding "write a better codes" , can you give a suggestion for login funation with user name and password authenication?
|
|
|
|
|
Your SQL should live in a seperate dll, so that you can make sure that any method you need to write, you only write it once, and you have a central point to manage your database code.
For checking a login, you should write SQL like
select count(*) from username where username = @username and password = @password
The points are
1 - use parameterised queries ( I can't recall if you did )
2 - write SQL that doesn't ever place the password into memory, it just returns if the one you gave it was correct.
Of course, we can't learn it all at once, so perhaps your teacher will cover this sort of stuff a bit further down the line. That's why I said, if you're a student, the code is probably fine, but if it was going to be run in the real world, then there are issues.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
okay. Thank you for your help.
|
|
|
|
|
i create an online music listen website in asp.net with c#,in my site i want to play selected song in any flash player when we click a play button in grideview.please give me an appropriate answer.
|
|
|
|
|
What do you mean by 'any flash player' ? You need to embed a flash player in your site, and create links that play the song in that player.
I assume you own all this music ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I assume you own all this music ?
ofcourse!
|
|
|
|
|
You wrote the music, or you own a record company ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
There are lots of free flash players available... U might embed them or you can create your own.
when player calls the server, buffer the song and play it in the player.
|
|
|
|
|
hi
I want in button_click create a text box and add to placeholder.
in fact, I want by each click add a textbox to my page.
how?
thanks
|
|
|
|