|
more senario
for i = 0 to aList.Count - 2
j= i + 1 to aList.Count - 1
aa(i) = myFunction (aList(0,0), aList(0,1), aList(1,0), aList(1,1)
like this
Sarfarj Ahmed
|
|
|
|
|
|
Array list is nothing but collections of item, you can not store 2 value on same index.
|
|
|
|
|
Kunal Pawar wrote: Array list is nothing but collections of item, you can not store 2 value on same index.
So, if it is a collection of item, can't you have an item composed of many things which is stored on single index.
' Creates and initializes a new ArrayList.
Dim myAL As New ArrayList()
myAL.Add("1,2")
myAL.Add("3,4")
myAL.Add("5,6")
I'm not saying this is the most efficient way of doing it, just showing you that you can store more than one item in an index, by creating collection.
Yusuf
|
|
|
|
|
Hi All,,
I Want To Add Controls at run time to a web page,,
How I Can Do That ,, (textbox,dropdownlist,and etc....);
thanks all;
|
|
|
|
|
Basically, instantiate control classes from System.Web.UI.WebControls , set properties, and add to a container using Controls.Add() .
Take a look at the following example:
TextBox txt1 = new TextBox();
txt1.Width = ...
txt1.height = ...
this.Controls.Add(txt1);
Calin
|
|
|
|
|
IF you want to add control at runtime, its always better to do it with javascript. Because during runtime, if the page is not posted back, server side runtime controls will not appear.
Use
var element = document.createElement('input');
somediv.appendChild(element);
Abhishek Sur
|
|
|
|
|
Hi.
I've created a runtime instance of a class by reflection.
How could I access its methods and run them ?
Best wishes
|
|
|
|
|
Look at Type.GetMethod and MethodInfo.Invoke methods.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi
Please tell me how can we send email from an ASP.net application to a yahoo or gmail account?
Thanks
|
|
|
|
|
to send an email from your application you have to ways: 1- use smtp server of your own 2- use one of the free smtp servers like gmail's
accordingly after choosing your smtp there are two coding ways that goes as below:
1- add namespace of System.Net.mail;
2-in the click event of your [Send Email] button:
MailMessage mailmsg= new MailMessage();
mailmsg.From = new MailAddress("Your Email Address");
mailmsg.To.Add("Email of reciver");
mailmsg.Subject = "Your sybject";
mailmsg.Body = "The body of your mail (You can use html tags too";
mailmsg.IsBodyHtml = true;
SmtpClient smpt= new SmtpClient("127.0.0.1"); [if you are using your application in your own host]
smtp.Send(mailmsg);
-----------------------
Now if you don't have your own smtp and wanna use free one like google's do as below:
1- add the same name space
2- Code as below:
string subject = "Your Subject";
string from = "Your Gmail account having @gmail.com";
string rec = "reciver email";
string body = "The mail body.";
MailMessage mail = new MailMessage(from, rec);
mail.IsBodyHtml = true;
mail.SubjectEncoding = System.Text.UnicodeEncoding.UTF8;
mail.Subject = subject;
mail.Body = body;
SmtpClient sm = new SmtpClient();
System.Net.NetworkCredential me = new System.Net.NetworkCredential();
me.UserName = "your gmail username";
me.Password = "your gmail password";
sm.UseDefaultCredentials = false;
sm.Credentials = me;
sm.Host = "smtp.gmail.com";
sm.Port = 587;
sm.EnableSsl = true;
sm.Send(mail);
hope it works
Proper Prepration Prevents Poor Performance! h
|
|
|
|
|
I wrote an article on how to use google. Because sending an email is
1 - trivial
2 - widely documented
3 - asked here often
I based my tutorial on how to use google to search for how to send an email. Really 'send email C#' is all you needed, but I suggest you read the article anyhow.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi friends i m looking coding for dynmaic controls. how to acess the value from a dynamic text box . if we r creating some text boxes at run times then how will we retain thr value when page unload or postback .i tried but the page looses the infro. of dynamic control on post back .
Thanks
Jasjit
|
|
|
|
|
<edit> I didn't realize this was answered before...
why are you posting this again See your answer here[^]
</edit>
Yusuf
modified on Sunday, March 1, 2009 1:07 AM
|
|
|
|
|
I am creating runtime textboxes on a button click events and when i submit my page info, it does not retain the information of those runtime textboxes..
although i have managed to store their ID's but not able to retain the values entered in textboxes:
|
|
|
|
|
response.cookie.remove["cookiename"] does not remove the cookie?
Is it that its removed only from server side
what is to be done to remove from client side..other than setting expiry date
|
|
|
|
|
|
hello,
I'm making a website with ASP.NET & C#.
There are a lot of controls. for example, button control, ListBox Control, etc..
I would like to use Tab Control.
In order to add the Control, I choose <tool> -> <tool box="" item="" choice="">.
and I added.
but any event was not happened.
could you help me how to add "tab control"?
Thanks.
p.s. I'm not native speaker, so I don't know if my words make sense.^^;
Thank you..
|
|
|
|
|
look at this [^] cp article
Yusuf
|
|
|
|
|
wow.. really thank you so much ^^
|
|
|
|
|
Hi all,
i am trying to use the following on asp.net / C# application:
On server side:
public static void AyudaContextual(System.Web.UI.WebControls.WebControl vControl, string Texto)
{
vControl.Attributes.Add("onmouseover", "OnMouseOver(txtInfo, " + Texto + ")");
}
On client side: (in-aspx page code):
<head runat="server">
<script type="text/javascript">
function OnMouseOver(TextBox, string) {
TextBox.style.backgroundColor = "#DEDFDE";
TextBox.style.color = "#006666";
TextBox.style.fontWeight = "normal";
TextBox.innerHTML = string;
}
</script>
</head>
as you can see, all i want is that when i hover my mouse on vControl control, its onmouseover event changes TexBox "txtInfo" appearence and puts some text ("Texto") inside it. But i have no idea how to specify the second argument (Texto), the other code seems to work.
I am new to asp.net so this question maybe is too simple.... thanks for helping me.
modified on Saturday, February 28, 2009 3:59 PM
|
|
|
|
|
try: vControl.Attributes.Add("onmouseover", "OnMouseOver(txtInfo, "'" + Texto + "'")");
|
|
|
|
|
Thanks Calin, got it working here.
Cheers
|
|
|
|
|
hi
I have this webpage called register.aspx. user has a form of 4 fields and completes them to get an activation email and ... .
Where I want to optimize my code is a place where I want to use a try & catch block where if user enters an existing username he will divert to catch block that tells him to reconsider about his/her username. I mean I want to stop username duplication, what kind of exeption or sql query do I need to use? Please inform me with details since I am kind of new
Thanks
Proper Prepration Prevents Poor Performance! h
|
|
|
|
|
You can put a primary key or unique constraint on the user name column and then, when the SqlException gets thrown because of violation of the constraint, you can display the error message to the user.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|