|
How to connect the pop3 mail server in asp.net
and how to retrieve the mails?
SR Ranjini
|
|
|
|
|
Hi there,
I do belive there r a lot of article on CP site. just do a quick search...
here is just one of them POP3
<< >>
|
|
|
|
|
Hi
In my application, i m using windows authentication. I want to restrict all the users of other group of a domain except one group. i.e (i have 3 groups in a domain namely admin, accounts, technical), i want to allow only admin group users to access my application thru windows authentiction and restrict all other group users in this domain.
How should i do that. Any code will be of great help to me
thanx
sandeep
|
|
|
|
|
I done this a few months ago and used this code.
I'm not sure if it is the most efficient but it works for me.
A couple of things to watch for;
remember to turn off anonymous authentication in iis and edit the web.config as in comments
string strUname = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();<br />
strUname = strUname.Substring(9,strUname.Length - 9);<br />
Boolean bIsAuthenticated = false;<br />
<br />
try<br />
{<br />
CustomClasses.Authenticate cAuthenticate = new Authenticate();<br />
StringCollection scGroups = (cAuthenticate.GetUserGroupMembership(strUname));<br />
foreach (string gp in scGroups)<br />
{<br />
if(gp.Substring(3,gp.Length - 3).ToUpper() == "DASHBOARD")<br />
bIsAuthenticated = true;<br />
else<br />
Session.Add("exception", "1");<br />
} <br />
}<br />
Hope this helps
Colin
|
|
|
|
|
Hi,
I have file of .ASPX extension from asp.net.I want to know, Is there any method to convert aspx file to asp file.
Similarly, Is it possible to convert asp file to aspx file .
Vijayendra Shinde.
|
|
|
|
|
Why do u need that?
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
if you want to go back to classical asp, just simply change the aspx extension to aspx
<< >>
|
|
|
|
|
I have created a crystal report in PDF. The file is created on the hard drive but. How can i open it in Webform? Please help me out.
do I need shell command?
if yes what will be the parameters?
|
|
|
|
|
Either save it under the web root and just use a URL and Response.Redirect to open it, or use the System.IO classes to stream it to the browser.
|
|
|
|
|
Dear all, I've a stranger problem here with the grid view, mine, is allowing paging with Pagersettings mode = 'NextPreviousFirstLast
each time i click the last page from the first page for the example, i got an index out of range exception cause it set the new index page = 2147483647..
can anybody help?
|
|
|
|
|
i have one dropdown list and i bind it but:
i want the content of dropdown list be Id and name
like: 1203/Frank
can u help me???????
|
|
|
|
|
Hi there,
You can change your datasource before binding it to ddl, you might have to change the SQL query to something like "select id+'/'+name...."
Anyway you should check the query again as I'm not sure if it's correct or not
<< >>
|
|
|
|
|
hi
thats not right i did that in asp.net(c#).
what should i write in this code insted of *
dropdownlist.datatextfield = "*";
|
|
|
|
|
hi
I dont know about this solution, but IMO if selecting datatextfield="*", that means all fields will be shown in ddl, right? if so, what is the delimeter between these fields?
Re. my suggestion, I think it's also correct as you just select 2 fields (id and name) and combine these into one field as your format, then just bind the combined field to ddl (SQL: select id+'/'+name as combinedfield....)
<< >>
|
|
|
|
|
Hi,
I think u can do it in Asp.NET and also in the SQL query. I just tried the same. Here it is...
SELECT ct.intUSCityId, ct.strUSCityName,CAST(ct.intUSCityId AS VARCHAR(50)) + '/' + ct.strUSCityName AS Vaib ,ct.isDeleted FROM tbCity AS ct
WHERE ct.intUSCountyId=10
To bind it to the dropdownlist
DropdownList.DataTextField = "Vaib";
DropdownList.DataValueField = "intUSCityId";
The other one ofcourse by concatenating ID+ "/" + "Name" in Asp.NET
It's working fairly well. So, I think u can use any of these methods
Thanks for reading,
Vaibhav
|
|
|
|
|
Hi,
I think u must be returning a DataSet to bind it to the dropdown containing "ID" and "Name"...You can do following to display "ID/Name" to DropdownList where ID & Name are column names u return through ur query.
if(ds!=null && ds.Tables.Count > 0)
{
if( ds.Tables[0].Rows.Count > 0)
{
ds.Tables[0].Columns.Add("strDisplay",typeof(System.String));
for(int i = 0 ; i < ds.Tables[0].Rows.Count;i++)
{
ds.Tables[0].Rows[i]["strDisplay"] = ds.Tables[0].Rows[i]["ID"] +"/" + ds.Tables[0].Rows[i]["Name"] ;
}
}
}
And to bind the dropdownlist
DropdownList.DataTextField = "strDisplay";
DropdownList.DataValueField = "Value";
I think this should work fine...
Thank u,
Vaibhav
|
|
|
|
|
yes sure it should work, but to be more efficient you can do this from SQL query....No need to load data into dataset and loop over all records in dataset to create the third column
<< >>
|
|
|
|
|
ya..That's a useful advice...
Thanks a lot..
|
|
|
|
|
You can use expression column in datatable. In this method, no need to loop through all the records.
Regards
R.Arockiapathinathan
|
|
|
|
|
Thanks a lot.. I tried this one and it's really very good
solution.
Thanks a lot for the help.
Thanks & regards,
Vaibhav
|
|
|
|
|
thanks for your help yes thats right.
|
|
|
|
|
hello sir,
can u tell me
how to create control from one string.
that is,
System.Web.UI.Control ctl =new WebDateChooser();
instead of this ,i have the bellow one,but it shows error (cannot convert string to
control)
System.Web.UI.Control ctl = "new WebDateChooser()";
plz help me sir..
bye
sureshkumar
|
|
|
|
|
Hi there,
I still not got ur clue How can you assign a string to an object?????
IMO, no way to assign a string to an object
<< >>
|
|
|
|
|
i dont want to assign string to an control.
but i want to create a control using string.
that is my input is "WebDateChooser"
using this input i need to genarate cotrol.
eg: WebDateChooser ctl=new WebDateChooser();
plz tell the solution.
sureshkumar
|
|
|
|
|
if so, just create control basing on the input string....
if you still got the problem, it'd be easier if you post the snippet of code here...
<< >>
|
|
|
|