|
Try to declare myMail object in the loop
Outlook.Application o = new Outlook.ApplicationClass();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
Outlook.MailItem myMail = (Outlook.MailItem)o.CreateItem(Outlook.OlItemType.olMailItem);
myMail.Recipients.Add(GridView1.Rows[i].Cells[0].Text);
myMail.Subject = "Check";
myMail.Body = "Its a Demo Mail. Good Afternoon";
myMail.Attachments.Add("C:/New1.txt", Missing.Value, Missing.Value, Missing.Value);
myMail.Send();
}
Nobody is perfect i'm Nobody
|
|
|
|
|
Thank u its working.
Prya
|
|
|
|
|
Hi
I am using Visual Studio 2003 and SQL Server 2000 to try and develop an E-Commerce website. Amongst others I have a Customers table, Suppliers table and a Roles table in the database. What is the standard procedure regarding storing usernames and passwords? At the moment I have Username and Password columns, as well as a foreign key column to the Roles table, in the Customers table as well as in the Suppliers table.
On my login page I have two radiobuttons so the user can specify whether they are logging in as a Customer or a Supplier. That determines then in which table I go to check the username and password. If the user is a valid user, the following line of code runs:
FormsAuthentication.RedirectFromLoginPage(userIndex.ToString(), ChkRemember.Checked);
The problem is that then I do not know how to use the Application_AuthenticateRequest() method in the Global.asax.cs. How would I specify in there which database table to be accessed to retrieve the roles? I tried using session variables, but they were not accepted in the Application_AuthenticateRequest() method.
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
string[] roles = Access_Customers.GetCustomerRoles(HttpContext.Current.User.Identity.Name);
HttpContext.Current.User = new GenericPrincipal(HttpContext.Current.User.Identity, roles);
}
Am I missing the point completely here? Is there a better way of approaching this? Perhaps have all login data (usernames and passwords in one table)?
What is better from a security point of view to use in authentication and authorization: Cookies or Session variables?
Thanks.
Kobus
|
|
|
|
|
Hi
If you have defined roles, user and password in database, then why u r using Application_AuthenticateRequest(Object sender, EventArgs e) event of globaal.cs. You can directly access through database by forms submit button.
Kumar
|
|
|
|
|
hi,
i want to know how should i return values from jagged arrays
public string[][] fync(Type webtype)
{
string[][] dimen= new string[3][];
dimen = getDetails(Type Webtype);
//how should i collect values in dimen
}
public string[][] getDetails(Type webtype)
{
//suppose ss is jagged array of dimension ss[3][]
//ie i have ss[0] = i have something
// ss[1]= i have something else
// ss[2]= i have some third item
return ss;
}
I hope i am doing right
help please
Thanks JIny
|
|
|
|
|
A jagged array is just an array of arrays. To create one you first create the main array, then create each sub-array:
string[][] ss;
ss = new string[3][];
ss[0] = new string[] { "Some", "strings" };
ss[1] = new string[] { "Some", "more", "strings" };
ss[2] = new string[2];
ss[2][0] = "Individual";
ss[2][1] = "strings";
When you get the jagged array from the function, you shouldn't create an array first. That only means that you create an array that you will just throw away. Just declare the reference for the array:
string[][] dimen;
dimen = getDetails(webtype);
---
b { font-weight: normal; }
|
|
|
|
|
Hi friends,
I just have one small doubt. I just inserted one button into the itemtempelate of a datalist and without writitng any code i ran the project. i tried the same with repeater and datagrid. but the button inserted was not to be seen in any of the above mentioned controls. Where as when i inserted a button to a form i was able to see that button. can anyone tell me why is it like that.
Vipin
|
|
|
|
|
The DataList control is a data-bound control like Repeater, DataGrid. It means you need to bind a datasource to the control to create the UI, otherwise the control displays nothing. You can read more about how to use these controls in MSDN.
|
|
|
|
|
I'm playing by the rules, I have a theme setup with a skin file for all my control style settings.
For some reason as I'm working what appear to be defaults for styles for controls keep creeping back into my aspx page and overriding my .skin file.
I think when I bring up the properties of a component in the visual designer and change something innocuous like enableviewstate it's automatically setting a bunch of default style settings that I had just removed.
Is there any setting or way to prevent visual studio from setting any default style settings for components either existing ones or when putting new ones on the forms?
(or is this just a half implemented feature?)
P.S. And why doesn't it preview the page in the designer with the settings in the skin file (or is this again a half implemented feature?)
|
|
|
|
|
Hi there,
What do the generated style settings contain? Are they all related to positioning like left, top ...or something else?
|
|
|
|
|
I don't have it in front of me but definitely settings for fonts etc.
I'm now wondering if it's only the infragistics components that are doing this. I nearly work with only infragistics components so perhaps it's something that doesn't happen with the "stock" ms components.
|
|
|
|
|
Hello all,
I have a very small problem, but could not find the solution.
I have a link button on aspx page. I have some functionality in the link button's click event. I have some data on client side. I want those data from the client side to the server side when somebody click on the link button.For say, I have three datafields in javascript file, which contains data- eventid, date, name. Well, I don't know the AJAX tech., but I would like to implement it if somebody help me out in this problem.
Thanks,
Robin
|
|
|
|
|
If the entire web page is reloaded when the user hits the button, then you simply persist the client side data in a hidden field so that it can be posted to the server and you can easily access it. You might only consider using AJAX when you don't want to reload the entire web page, and you surely can find lots of tutorials out there with your friend Google.
|
|
|
|
|
Hi, from Italy,
I've a problem with a RegularExpressionValidator.
I want validate a textbox following these condition:
1) length must be beetween 3 and 7 charachters
2) spaces not allowed
3) must contains at least 2 of these special charachters ($,%,&,/,(,),=,£,")
4) must contains only these special charachters ($,%,&,/,(,),=,£,"), numbers, letters (uppercase and lowercase) and no spaces
It's too difficult for me.
In Italy there aren't serious guidelines for RegularExpressions, and i've not find answer to my questions online in other sites.
Please help me, i know you can.
thank you.
|
|
|
|
|
|
tranky wrote: Hi, from Italy,
Ah Italy, the FIFA World Cup 2006 Winner, Congratulations !
Just want to second the first reply, you can take the similar expression[^] with the Expresso tool from the link above to produce an expression that meets your need
|
|
|
|
|
When I use absolute positioning ( position:absolute; left:376px; top:25px; ) in a html control to position an image-button like this one:
________________________________________________________
<img src="Images/genericbtn.gif" alt="" border="0" usemap="#Map4" style="position:absolute; left:376px; top:25px; z-index:3; width: 95px; height: 23px;"/>
<map id="Map4">
<area shape="poly" coords="94,0, 93,7, 78,22, 0,21, 1,15, 15,0" href="ShoppingCart.aspx" />
</map>
_____________________________________________________________________________________
It works fine. It gets positioned where it is supposed to.
However, when I use a web control instead ( because I need a C# OnClick event handler ) like this:
_______________________________________________________________________________________
<asp:ImageMap ID="checkout" CssClass="CheckBtn" ImageUrl="~/Images/genericbtn.gif" OnClick="checkout_Click" hotspotmode="PostBack" runat="server">
<asp:PolygonHotSpot Coordinates="94,0, 93,7, 78,22, 0,21, 1,15, 15,0" postbackvalue="Yes" />
</asp:ImageMap>
_______________________________________________________________________________________
And using this CSS code:
___________________________________
.CheckBtn
{
position:absolute;
left:470px;
top:25px;
z-index:5;
width: 95px;
height: 23px;
}
___________________________________
It does not obey the “left” absolute coordenate. Instead Visual Studio throw it close to the left window border.
1-Is there a solution for that ?
2- I also notice that when you change the CSS absolute position of a html control in the code, VS not always updates it immediately through compilation. Instead it updates it unpredictably and only when you close and run VS again several times.
The same happens when you replace a image file but keeps its old name. VS does not updates the image.
Why that happens ? How to fix it ?
|
|
|
|
|
2: CSS files and images are cached in the browser. Try to press control+F5 to update, otherwise empty the cache and update.
---
b { font-weight: normal; }
|
|
|
|
|
Hy Guffa
I use almost always Control+F5 which is the command for Start Compiling and Running without Debugging. It does not update the images.
What should I do to empty the cache ?
|
|
|
|
|
Hy Guffa
I just found out how to update the web forms.
It is ridiculously simple. It needs just pressing the browser "Refresh" button !!!
Thank you anyway.
|
|
|
|
|
Use control+F5 in the browser to update the page in the browser.
You mean to say that you never used F5 to update the page in the browser?
---
b { font-weight: normal; }
|
|
|
|
|
Recently I decided to build one of these customers website on asp.net 2.0 after I found the hosting company I always work with, now is supporting version 2. I used the default membership provider using the SQLExpress on my local, though the other database stuff was on Sql Server 2000. After uploading the site, I found the error which says the Sql Server 2005 do not allows remote connections, and I discovered that the host doesnt support sqlexpress, so I ran aspnet_regsql tool on my main database and changed all connection strings to reffer it. I changed the LocalSqlServer connection string as well. But now I receieve this error on the host:(I ran all sql scripts provided by the tool on the hosting database as well)
The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.
And this one on my local
Cannot insert the value NULL into column 'RoleId', table 'milad_ghadami.dbo.aspnet_Roles'; column does not allow nulls. INSERT fails.
The statement has been terminated.
milad_ghadami is my database name.
What do you think? Does it mean that this stuff won't work on Sql Server and just work on SqlExpress? Or there is anything I am missing?
Mat Lotus
|
|
|
|
|
A couple of things that you can do:
+ Open and check data in the 2 columns Feature and CompatibleSchemaVersion of the aspnet_SchemaVersions table
+ Bypass this checking by modifying the store procedure aspnet_CheckSchemaVersion to always return 0.
+ Create your own custom provider which does not check the compatible version.
|
|
|
|
|
Hi There,
I'am working in a project with VWD express edition, and I want to know where to find dll files, or how to set project to put dll into bin directory, from compiled source files (C#).
Tks in Advance,
|
|
|
|
|
_ronald wrote: I want to know where to find dll files
Do you mean you want to look for the output assemblies of the web site?
|
|
|
|
|