|
|
(a.) I am a beginner to ASP.NET and VB.NET
(b.) I created a LOGIN table with two fields "username" and "password"
(c.) The login Is allowed to only ONE ADMINISTRATOR
(d.) The login form is Home.aspx
(e.) After login it should go to Admin.aspx
(f.) Suppose the code for accesing the USERNAME field from database is below
obj.dr("username")
1. Give me a SIMPLE code for Login Button Click event
2. Give me a SIMPLE code for SignOut Button Click event
3. Give me a SIMPLE code for Checking whether if logged in during "page load event" of each forms.
|
|
|
|
|
Gjm wrote: 1. Give me a SIMPLE code for Login Button Click event
2. Give me a SIMPLE code for SignOut Button Click event
3. Give me a SIMPLE code for Checking whether if logged in during "page load event" of each forms.
Buy some Beginners Book and Read yourself. If stuck then ask, no one will provide you the source code in this way.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
USING CAPS is akin to shouting. "Give me" is imperative. It is an order.
So you are shouting orders to people to give you the code you are either (a) unable or (b) unwilling to write.
Why on Earth did you bother posting? Did you honestly expect anyone to help with an attitude like that?
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
Forget about doing all that manually, if you are new you are gonna have a hard time
Use the integrated membership functions of asp.net
Alexei Rodriguez
|
|
|
|
|
I have created One dynamically
Such as
Doctor 00.00 00.15 00.30 00.45 1.00 1.15 1.30 1.45 2.00 .....till 11.45
A medium critical medium medium medium low High
This is coming when the page loads...
now I have 2 drop down boxes using that user can select time which he wants to display..
Suppose user select between 1 to 2 Then last 4 column should come,
For this i m using this function
private void loadDynamicGrid(Int32 startTime , Int32 endTime)
{
// #region Code for preparing the DataTable
//Create an instance of DataTable
//Create an ID column for adding to the Datatable
dt = new DataTable();
DataColumn dcol = new DataColumn(ID, typeof(System.Int32));
dcol.AutoIncrement = true;
dt.Columns.Add(dcol);
DataRow drow = null;
drow = dt.NewRow();
//Add the row to the datatable.
dt.Rows.Add(drow);
foreach (DataColumn col in dt.Columns)
{
//Declare the bound field and allocate memory for the bound field.
//for (Int32 index = 0; index <= 95; index++)
//{
// BoundField bfield = new BoundField();
// Int32 var = index / 4;
// if (index % 4 == 0)
// {
// if (index < 40)
// {
// bfield.HeaderText = (index / 4) + ":00";
// }
// else
// {
// bfield.HeaderText = (index / 4) + ":00";
// }
// }
// else
// {
// bfield.HeaderText = var + ":" + ((index % 4) * 15);
// }
// //Add the newly created bound field to the GridView.
// GrdDynamic.Columns.Add(bfield);
//}
for (Int32 index = startTime; index < endTime; index++)
{
Int32 hour = index;
for (Int32 minute = 0; minute <= 3; minute++)
{
BoundField bfield = new BoundField();
bfield.HeaderText = ((hour.ToString()) +":"+ (15 * minute));
GrdDynamic.Columns.Add(bfield);
}
}
}
//Initialize the DataSource
GrdDynamic.DataSource = dt;
//Bind the datatable with the GridView.
GrdDynamic.DataBind();
}
during page load i am passing calling loadDynamicGrid(0, 24)
and on dropdown_selectIndexChange()I m calling loadDynamicGrid( 1,2)
But this is adding at the end of grid not removing other column..
How to solve this problem
but this
|
|
|
|
|
Hi there, I saw different techniques to solve FileUpload-Ajax problem. But nothing works for me.
I got a gridview showing all my products, there is a button to open my AddProduct Panel to Add New products.
If I provide all my product details it saves everything except the file(value in FileUpload) in my DB.
I tried Triggers, but it doesnt make any difference.
sample code:
if (picUpload.HasFile)
{
string strpath = Server.MapPath("../ProductPicture/");
picUpload.SaveAs(strpath + picUpload.FileName);
}
product.Picture = picUpload.FileName; //saves filename in DB
Sample Markup:
<triggers>
<asp:postbacktrigger controlid="btnAdd"/> /* button btnAdd adds form values into DB */
</triggers>
=============
|
|
|
|
|
hi,
File upload control does not work with Update panel since it doesn't support asynchronous postbacks.
It requires full post back to occur.
So use
<triggers>
<asp:postbacktrigger controlid="Button1">
within the UpdatePanel and outside of the ContentTemplate
|
|
|
|
|
I have created Grid view dynamically at run time
Suppose
Doctor 00.15 00.30 00.45 1.00
A
B
C
D
E
now if i click any cell then how can i pop up another form. so that i can save records such as name , age and age will come into the cell.
I can select multiple cells of one rows.
|
|
|
|
|
You can either make the information in the cell linked via an anchor which will call javascript in the href to pop up an ajax modal dialog, or wrap the contents in a span and add the onclick event handler to that.
Should you need to change the contents of the cell on return from the form, use javascript to change the anchor or span innerText property.
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
Dim mmsg As String
Dim mto As String
Dim mfrom As String
Dim msubject As String
mto = TextBox1.Text
mfrom = TextBox2.Text
msubject = TextBox3.Text
mmsg = TextBox4.Text
Try
Dim message As New MailMessage(mfrom, mto, msubject, mmsg)
'Dim mysc As New SmtpClient(msr, mport)
Dim mysc As SmtpClient = New SmtpClient("127.0.0.1")
mysc.Port = "25"
mysc.UseDefaultCredentials = True
mysc.Send(message)
MsgBox("the messgage has been sent to '" + message.To.ToString + "' ", MsgBoxStyle.OkOnly)
Catch ex As FormatException
MsgBox("Format exception:" & ex.Message)
Catch ex As SmtpException
MsgBox("SMTP exception:" & ex.Message)
Catch ex As Exception
MsgBox("General exception:" & ex.Message)
End Try
End Sub
above code dosent put any error but email dose not send ,it stay in
C:\Inetpub\mailroot\Queue ,why so happen. Please hlep me. I tried about couple of week but i could not able to solve it.
Thanks
Dipak
|
|
|
|
|
D.K.C wrote: ,it stay in
C:\Inetpub\mailroot\Queue
Your SMTP server is not running.
|
|
|
|
|
Thanks for Replay.
1)I have checked my domian by telnet om 25, which not throw any error,
its ready for emailing.
2)then any other way to check smpt server , is it working ? or Not.
3) IsRemote domain same as Smart Host ?
please hlelp me.
Thanks again...
|
|
|
|
|
This solution helped me a while back. Not sure what exactly it fixed, but it did work (for me at least):
http://forums.devshed.com/iis-97/mail-stuck-in-queue-folder-iis-smtp-virtual-server-windows-xp-service-361246.html[^]">
|
|
|
|
|
I must use this old & deprecated (by me ) object in a ASP.Net 1.1 environment... it works (aehm...) fine until I try delete the physical files I've added to the mail...
Code is like this :
.. bla bla bla...
Dim myMail As New MailMessage
myMail.From = "from@my.com"
myMail.To = "to@my.com"
myMail.Subject = "test"
myMail.Priority = MailPriority.Normal
'filename is a PDF file that exists
Dim mailAtt As New MailAttachment(sFilename)
myMail.Attachments.Add(mailAtt)
myMail.BodyFormat = MailFormat.Html
myMail.Body = xBody 'Loaded from a string
If (System.IO.File.Exists(sFilename)) Then 'to be sure
'System.IO.File.Delete(sFilename)
End If
if I delete attchment SMTP object returns me an error of "File not found" why?
|
|
|
|
|
ddepauli wrote: filename is a PDF file that exists
Dim mailAtt As New MailAttachment(sFilename)
myMail.Attachments.Add(mailAtt)
myMail.BodyFormat = MailFormat.Html
myMail.Body = xBody 'Loaded from a string
If (System.IO.File.Exists(sFilename)) Then 'to be sure Poke tongue
'System.IO.File.Delete(sFilename)
End If
if I delete attchment SMTP object returns me an error of "File not found" Confused why?
Why are you deleting the file before sending the Mail ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
ahaha sorry I've copyed wrong code.. delete is made AFTER sending..
|
|
|
|
|
ddepauli wrote: If (System.IO.File.Exists(sFilename)) Then 'to be sure
'System.IO.File.Delete(sFilename)
End If
Does this precede invoking the Send method?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Sorry guys.....
I already posted this question.
This time i like explain clearly what i done and where i am getting problem.
I built a caluclator in .aspx page with button which look exacltly like a real caluclator.
It works fine until taking number into textbox when i click the number button
But when i click the = button the result is not displayed
i am keeping my code here....plz help me
protected void btnplus_Click(object sender, EventArgs e)
{
valholder1.Value = txtcal.Text;
sign = "+";
txtcal.Text = "";
}
protected void btnequal_Click(object sender, EventArgs e)
{
valholder2 = Convert.ToDouble(txtcal.Text);
if (sign == "+")
txtcal.Text = Convert.ToString(valholder2 + Convert.ToDouble (valholder1));
}
Here i took the valueholder1 and valueholder2 to store the values
and i want to display the result in textbox
plz help me.........
Thanx in advance
|
|
|
|
|
|
Hello,
I have placed 5 textboxes on a web page (ASP.NET using VB) and one for input of sum above 5 textboxes. I want to validate the 6th textbox something like it.. suppose sum of 5 textboxes is 1032 and now focus is in 6th (i.e. total) textbox; so here only "1032" characters should be allowed no other; and they should be in this order only; not like 1302 or something like (after pressing 1 it will accept only 0 no other key). How to get this feature please tell me. I know this can be achieved by javascript but less knowledge throw me in the forum.
Thanks & Regards
Girish Sharma
|
|
|
|
|
|
User have to feed the sum in the 6th textbox to verify the sum.
|
|
|
|
|
Hi,
Don't allow User to Calculate the Sum in which case there is a chance to enter the wrong value.
So You must calculate the value on the textChange Event of the 5th TextBox.
This is very Simple.
Bye.
Learner will gain more knowledge than Teacher.
|
|
|
|
|
This is my business need please.
User is doing the data feeding job in this web application. He will enter 5 number and 6th as sum of 5. Now if 1.user has done mistake or 2.the input source(a pre-printed data sheet which will be written by other staff) is having mistake; can be traced out and it will stop to error in database. He will only allowed to feed the right digits in the right order only or press escape key to recorrect the value(s) of above any of 5 inputs.
Thanks & Regards
Girish Sharma
|
|
|
|