25 new messages in 15 topics - digest [9 May 2008]

Today's topics:


== 1 of 1 ==
Date: Thurs, May 8 2008 6:37 am
From: "Mike Gleason jr Couturier"



"Mike Gleason jr Couturier" <nospam@invalidhost.com> a écrit dans le message
de news: uLFlgsQsIHA.1240@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> I'm uploading a text file (.csv) dynamically to the client with this
> method :
>
> --
> Response.Clear();
> Response.AddHeader("Content-disposition:", "attachment;
> filename=export.csv");
> Response.AddHeader("Content-type", "application/vnd.ms-excel");
> Response.ContentEncoding = Encoding.UTF8;
>
> Response.Write([...]);
> Response.Write([...]);
>
> Response.End();
> --
> Some accentuated acharacters does not display correctly in excel... but
> when I open the file the characters are displayed fine.. and notepad tells
> me that the file is indeed a UTF-8 file (when file/save as)..
>
> Im I missing something here? (apparently yes!)
>
> Thanks guys (and or gals)
>
> Mike
>
>

I've managed to get it done by:

Response.AddHeader("Content-disposition:", "attachment;
filename=export.csv");
Response.AddHeader("Content-type", "application/vnd.ms-excel;
charset=ISO-8859-1");
Response.Charset = "ISO-8859-1";
Response.ContentEncoding = Encoding.GetEncoding("ISO-8859-1");
I don't really need UTF8... my text was in latin iso  :|

Mike







==============================================================================
TOPIC: Use class ... why is not available?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/1137f4c408c684a8?hl=en
==============================================================================

== 1 of 4 ==
Date: Thurs, May 8 2008 6:59 am
From: shapper


Hello,

I am working with VS 2008 and created a Web Application Project.

I added a class but whatever I do the class is not visible to my aspx
pages or anywhere else.

I then changed the property Build Action in my class from Content to
Compile. Now it is recognized.

Why do I need to do this?

Do I need to do this with all classes I create?

Thanks,

Miguel




== 2 of 4 ==
Date: Thurs, May 8 2008 7:13 am
From: "Mark Rae [MVP]"


"shapper" <mdmoura@gmail.com> wrote in message
news:811ff1c6-7f0c-4849-96e4-7d55f109b3f7@a23g2000hsc.googlegroups.com...

> I added a class but whatever I do the class is not visible to my aspx
> pages or anywhere else.
>
> I then changed the property Build Action in my class from Content to
> Compile. Now it is recognized.
>
> Why do I need to do this?

Sounds like something's up with your installation of VS.NET, as classes
(should) have their Build Action property set to Compile by default...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net





== 3 of 4 ==
Date: Thurs, May 8 2008 9:43 am
From: shapper


On May 8, 3:13 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote:
> "shapper" <mdmo...@gmail.com> wrote in message
>
> news:811ff1c6-7f0c-4849-96e4-7d55f109b3f7@a23g2000hsc.googlegroups.com...
>
> > I added a class but whatever I do the class is not visible to my aspx
> > pages or anywhere else.
>
> > I then changed the property Build Action in my class from Content to
> > Compile. Now it is recognized.
>
> > Why do I need to do this?
>
> Sounds like something's up with your installation of VS.NET, as classes
> (should) have their Build Action property set to Compile by default...
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

Hi,

I think the problem is where the classes are being added to.
App_Folder or somewhere else.

I created a Web Application Project.

When I add a class to App_Folder it VS 2008 makes "Build: Content". If
I add the class somewhere else it says "Build: Compile".

The problem is when I create classes in App_Folder they don't seem to
be accessible to ASPX pages as it is usual in Web Site.

When I changed them "Build: Compile" then I am able to build the
solution with no errors but when I preview an ASPX pages I get errors
everywhere.

The only solution I found was to make all classes "Build: Compile" and
rename the App_Code folder to New_App_Code.

I think I am missing something.

Any idea?

Thanks,

Miguel




== 4 of 4 ==
Date: Thurs, May 8 2008 10:25 am
From: "Juan T. Llibre"


re:
!> The problem is when I create classes in App_Folder they don't
!> seem to be accessible to ASPX pages as it is usual in Web Site.

!> The only solution I found was to make all classes "Build: Compile"
!> and rename the App_Code folder to New_App_Code.

Have you tried putting all your classes in the App_Code folder, instead of in your App_Folder folder ?

ASP.NET will not automatically compile classes in application folders,
but *will* compile classes in source files in the App_Code folder.

Better yet, have you considered compiling your helper classes
into assemblies and placing the dll's in your app's bin directory ?





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"shapper" <mdmoura@gmail.com> wrote in message news:93187d96-3ff0-4157-956f-d6d1bdbc12cc@r66g2000hsg.googlegroups.com...
> On May 8, 3:13 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote:
>> "shapper" <mdmo...@gmail.com> wrote in message
>>
>> news:811ff1c6-7f0c-4849-96e4-7d55f109b3f7@a23g2000hsc.googlegroups.com...
>>
>> > I added a class but whatever I do the class is not visible to my aspx
>> > pages or anywhere else.
>>
>> > I then changed the property Build Action in my class from Content to
>> > Compile. Now it is recognized.
>>
>> > Why do I need to do this?
>>
>> Sounds like something's up with your installation of VS.NET, as classes
>> (should) have their Build Action property set to Compile by default...
>>
>> --
>> Mark Rae
>> ASP.NET MVPhttp://www.markrae.net
>
> Hi,
>
> I think the problem is where the classes are being added to.
> App_Folder or somewhere else.
>
> I created a Web Application Project.
>
> When I add a class to App_Folder it VS 2008 makes "Build: Content". If
> I add the class somewhere else it says "Build: Compile".
>
> The problem is when I create classes in App_Folder they don't seem to
> be accessible to ASPX pages as it is usual in Web Site.
>
> When I changed them "Build: Compile" then I am able to build the
> solution with no errors but when I preview an ASPX pages I get errors
> everywhere.
>
> The only solution I found was to make all classes "Build: Compile" and
> rename the App_Code folder to New_App_Code.
>
> I think I am missing something.
>
> Any idea?
>
> Thanks,
>
> Miguel







==============================================================================
TOPIC: Problem with session variables
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/9f4219945f0b875b?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 7:04 am
From: OscarArg


No, no load balancing, a single Web server and a separate, single ISA server
2004 on W2003 server.
I think that as the requested URLs are the same for every user the ISA is
somehow caching the pages based just on the URL and when another user
requests the same page from another session, the ISA serves the cached page
instead of forwarding the request to the web server. ... Could this be the
case, and if so, how could it be prevented?


"darrel" wrote:

> > However, when conecting thru an ISA server, sometimes one user sees
> > information belonging to another recent user.
>
> Are you using ISA for load balancing? If so, then there's likely more than
> one server and you'll have to configure IIS on the servers to handle SQL
> based session variables.
>
> -Darrel
>
>
>





==============================================================================
TOPIC: How to Create Drill Down on Web Page
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/69797b51b6222827?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 7:07 am
From: "Juan T. Llibre"


re:
!> when I try to run it an error message appears:

!> "A project with an Output Type of Class Library cannot be started
!> directly.  In order to debug this project, add an executable project
!> to this solution which references the library project.  Set the
!> executable project as the startup project."

Egads! I didn't realize that example is for Windows Forms, not for Web Forms.

I'll try to hunt down a dependent listboxes web sample I wrote some time ago.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Mel" <MLightsOut@gmail.com> wrote in message news:d85b81cc-2907-4cae-95d0-2300cb978304@r66g2000hsg.googlegroups.com...
On May 7, 6:08 pm, "Juan T. Llibre" <nomailrepl...@nowhere.com> wrote:
> re:
> !> I want to create something like when you search for car
> !> parts the user can navigate the drill downs
>
> Here's a complete example you can adapt :http://www.codeproject.com/KB/combobox/DrillDown.aspx
>
> re:
> !> at the top of the page is says something like this:
> !> Chevy>>2002>>Avalanche>>1500
>
> Are you thinking of breadcrumbs ?
> Usually an "at the top of the page" display refers to directories, not to data.
>
> Juan T. Llibre, asp.net MVP
> asp.net faq :http://asp.net.do/faq/
> foros de asp.net, en español :http://asp.net.do/foros/
> ======================================
>
> "Mel" <MLights...@gmail.com> wrote in messagenews:7865232b-53e8-483c-a65d-b79313d299cc@s50g2000hsb.googlegroups.com...
> > Can anyone provide any help on how I would create a drill down on a
> > web page?  I want to create something like when you search for car
> > parts the user can navigate the drill downs and at the top of the page
> > is says something like this:
>
> > Chevy>>2002>>Avalanche>>1500
>
> > What is the database behind it?  I want to use an Access Database to
> > store the data is that possible?  How would the database be
> > structured?
>
> > (Using Asp.net 2.0, VB.net)

Unfortunately the code project example is in C#, which I am not very
familiar with at all, but that is exactly what I am looking for.  I
converted the example project with Visual Studio 2005 and when I try
to run it an error message appears:

"A project with an Output Type of Class Library cannot be started
directly.  In order to debug this project, add an executable project
to this solution which references the library project.  Set the
executable project as the startup project."

This message makes no sense to me.  What do I need to do here?







==============================================================================
TOPIC: MS Design template installation problem
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/11f4389f384a310d?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 7:12 am
From: Nilla


Never mind.. the problem eas that I'm a moron.
The templates where of course located under New Web Application, not
under New Project!
Sorry.






==============================================================================
TOPIC: Getting the DataKey Value in a GridView
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/6c128794197d573c?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 7:34 am
From: "Mark Rae [MVP]"


"Wannabe" <Wannabe@discussions.microsoft.com> wrote in message
news:60CA5B12-682D-44E8-95CE-E4639D7303EC@microsoft.com...

> I have a gridview that has a label field and a checkbox field in it. I
> have
> the checkbox set to autopost when changed. How can I get the datakey value
> that is assigned to that row when a checkbox is either checked or
> unchecked?

protected void MyCheckBox_OnCheckedChanged(object sender, EventArgs e)
{
   int intDataKey =
Convert.ToInt32(MyGridView.DataKeys[((GridViewRow)((CheckBox)sender).Parent.Parent).RowIndex].Value);
   // rest of code
}


--
Mark Rae
ASP.NET MVP
http://www.markrae.net






==============================================================================
TOPIC: Uploading a directory instead of a file
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/cb7774d561ff8cc9?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 7:48 am
From: Shane43


On May 7, 2:45 am, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote:
> "K Viltersten" <t...@viltersten.com> wrote in message
>
> news:op.uar16v1ji74t80@lp028.pagero.local...
>
> > as the requirement is to code the project using MS products solely
>
> That is really short-sighted, IMO...
>
> Whenever I've been faced with a similar situation in the past, my usual
> response is "No problem - it will probably take me several months to develop
> what you want, at my standard daily rate. Alternatively, you can have it
> this afternoon for a few hundred dollars..."
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

I strongly agree with Mark on this one. Perhaps you should go back to
your customer and figure out what they really want, not what they
THINK they want...big difference...I've seen customers that
mandate .NET, or SOA, when all they really needed was a simple
javascript solution - they just thought they wanted the latest and
greatest buzzwords.

Good luck!
Shane





==============================================================================
TOPIC: Displaying HTML Docs on a WebPage
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/5d0910c7b7d5ed8a?hl=en
==============================================================================

== 1 of 3 ==
Date: Thurs, May 8 2008 7:57 am
From: "GaryDean"


Cramer,
Thanks.  The literal control worked great.
Gary

--
Regards,
Gary Blakely
Dean Blakely & Associates
www.deanblakely.com
"Cramer" <A@B.com> wrote in message
news:%23PpTfiLsIHA.5096@TK2MSFTNGP02.phx.gbl...
>
> "Norm" <neonorm@gmail.com> wrote in message
> news:c08fbafe-9c4d-4dcc-80f6-2f31e0ce9436@q27g2000prf.googlegroups.com...
> On May 7, 5:47 pm, "GaryDean" <gdeanblak...@newsgroup.nospam> wrote:
>>> I have HTML formatted documents stored in a database. I want to display
>>> them on a web page. However I see there is no "browser control" in asp
>>> (as
>>> there is in windows forms). This sounds kind of stupid but is there a
>>> control that I can load HTML into to display in a web page?
>>> Thanks,
>>> Gary
>
>>I would use either a literal control, or a label. Just set the .Text
>>property to the HTML from the DB.
>
> The Literal control allows you to inject text, verbatim, into the response
> stream. As such, any HTML you inject vai the Literal control would be
> something the browser would render. What you can do to prevent the browser
> from rendering the injected HTML is wrap the injected HTML in a <PRE> tag.
> So use the Literal control, but be sure to make use of the <PRE> tag...
> something like this:
>
> e.g., myLiteral.Text = @"<PRE> html code to display as html code goes
> here</PRE>";
>
>






== 2 of 3 ==
Date: Thurs, May 8 2008 7:58 am
From: "GaryDean"


Jialiang,
The literal control worked.  I stored the html as byte[] and then retrieved
it back and it was not escaped so things are fine.
Thanks for your help.
Gary

--
Regards,
Gary Blakely
Dean Blakely & Associates
www.deanblakely.com
"Jialiang Ge [MSFT]" <jialge@online.microsoft.com> wrote in message
news:hE7RcdNsIHA.1784@TK2MSFTNGHUB02.phx.gbl...
> Hello Gary,
>
> I agree with Norm and Cramer. Apart from theirs, I'd also suggest checking
> whether the HTML string from DB is escaped. Take the following code
> snippet
> as an example:
>
> 1, this.Label1.Text = "<font color='red'>test</font>";
> This will be rendered as "test" in red as we expected.
>
> 2, this.Label2.Text = "&lt;font color='red'&gt;test&lt;/font&gt;";
> '<' can be encoded as &lt;, and '>' can be encoded as &gt; and be stored
> into the DB. This piece of code will render the string as "<font
> color='red'>test</font>". And I believe this is not what you expected to
> see.
>
> 3, this.Label3.Text = System.Web.HttpUtility.HtmlDecode("&lt;font
> color='red'&gt;test&lt;/font&gt;");
> To resolve the problem in 2, we can use System.Web.HttpUtility.HtmlDecode
> to decode the string, and generate the same effect as 1.
>
> Please have a try and let us know if the suggestions help.
>
> Regards,
> Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>






== 3 of 3 ==
Date: Thurs, May 8 2008 8:33 am
From: bruce barker



in html, the <iframe> is the same as the browser control. with IE, its an
actual ie instance hosted on the page.


-- bruce (sqlwork.com)


"GaryDean" wrote:

> I have HTML formatted documents stored in a database.  I want to display
> them on a web page.  However I see there is no "browser control" in asp (as
> there is in windows forms).  This sounds kind of stupid but is there a
> control that I can load HTML into to display in a web page?
> Thanks,
> Gary
>
>
>





==============================================================================
TOPIC: Silverlight newsgroup?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/2683f0a54a85acae?hl=en
==============================================================================

== 1 of 2 ==
Date: Thurs, May 8 2008 8:08 am
From: "sloan"


Is there a place to request a new newsgroup?

..

Or does anyone know if the Forum model is better for silverlight?
http://silverlight.net/forums/



Just wondering.








== 2 of 2 ==
Date: Thurs, May 8 2008 8:22 am
From: "Leon Mayne"


"sloan" <sloan@ipass.net> wrote in message
news:%23m%2383zRsIHA.1872@TK2MSFTNGP04.phx.gbl...
> Is there a place to request a new newsgroup?
> Or does anyone know if the Forum model is better for silverlight?
> http://silverlight.net/forums/
> Just wondering.

There are some MSDN forums already for Silverlight:
http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=318&SiteID=1

I suspect it's the same with TFS, which doesn't have newsgroups either.






==============================================================================
TOPIC: how does one limit postback to a small section of screen?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/b41534b5d6c08beb?hl=en
==============================================================================

== 1 of 2 ==
Date: Thurs, May 8 2008 8:26 am
From: COHENMARVIN@lycos.com


I have a checkbox on my webpage which, if checked, should cause a
textbox to be enabled (or made visible).  But I find I need to make
the checkbox have a autopostback of TRUE for this to work.  Is there
any way, perhaps using Ajax update panels, to have a checkbox cause a
partial postback of only part of the page?
Thanks,
Marvin




== 2 of 2 ==
Date: Thurs, May 8 2008 8:41 am
From: bruce barker



this should be done in javascript, not ajax. no need to postback (may take a
couple seconds on the internet) just unhide or enable a control.

<script>
function setText(e)
{
  var  t= document.getElementById('<%=myTextbox.ClientID%>');
  t.disabled = !e.checked;
}
</script>
<asp:checkbox id="chk" runat="server" onclick="setText(this);"/><br>
<asp:textbox id="myTextbox" runat="server" Enabled="false" />

-- bruce (sqlwork.com)


"COHENMARVIN@lycos.com" wrote:

> I have a checkbox on my webpage which, if checked, should cause a
> textbox to be enabled (or made visible).  But I find I need to make
> the checkbox have a autopostback of TRUE for this to work.  Is there
> any way, perhaps using Ajax update panels, to have a checkbox cause a
> partial postback of only part of the page?
> Thanks,
> Marvin
>





==============================================================================
TOPIC: Authenticate against Active Directory
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/4cf97e2b32df7abf?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 9:50 am
From: ABHIJIT B


Hi Jon,

Two questions -
the AppSettings AD user and pass - do those need to be for the domain
admin?

It can be any user who can access all user details present in your
domain(e.g. firstname, lastname, email, loginid etc.).
If your site is hosted in QA/Production environment I suggest to have
Admin user credentials.

Second, the ActiveDirectoryServer variable - would that just be the
windows
machine name of the AD server or a full domain name, etc?

ActiveDirectoryServer  is domainname

In Web.Config you can mention for example :-

<add key="ActiveDirectoryServer" value="LDAP://xyznet.org" />
domainname
  <add key="ADUserName" value="xyz\jon" /> domainname\username or
simply username
  <add key="ADUserPassword" value="password" />

Regards,
Abhijit B

On May 8, 7:49 am, "Jon" <rosenb...@mainstreams.com> wrote:
> Thank you! I will try this and see if I can get it working. Two questions -
> the AppSettings AD user and pass - do those need to be for the domain admin?
> Second, the ActiveDirectoryServer variable - would that just be the windows
> machine name of the AD server or a full domain name, etc?
>
> Thanks, again
> Jon
>
> "ABHIJIT B" <abhijitbavdhan...@gmail.com> wrote in message
>
> news:4f07c019-1272-40f4-8ff3-3ca95b6bd586@e53g2000hsa.googlegroups.com...
> Hi Jon,
>
> I did AD authentication in one of my page in ASP.NET 2.0 , you can
> find same in 1.1
>
> /// <summary>
>     /// This will get user list.
>     /// </summary>
>     protected bool GetSearchUserData()
>     {
>         try
>         {
>             //Bind Search UserList grid  as per user entered
>
>             string loginName = txtSULoginName.Text;
>             string firstName = txtSUFirstName.Text;
>             string lastName = txtSULastName.Text;
>
>             string ActiveDirectoryServer =
> Convert.ToString(ConfigurationManager.AppSettings["ActiveDirectoryServer"])­;
>
>            // User that can access domain user details
>             string ADUserName =
> Convert.ToString(ConfigurationManager.AppSettings["ADUserName"]);
>             string ADUserPassword =
> Convert.ToString(ConfigurationManager.AppSettings["ADUserPassword"]);
>
>             DirectoryEntry entry = new
> DirectoryEntry(ActiveDirectoryServer, ADUserName, ADUserPassword);
>             DirectorySearcher ds = new DirectorySearcher(entry);
>
>             ds.Filter = "(&(objectClass=user)(objectClass=person))";
>             if (loginName != "")
>             {
>                 ds.Filter = ds.Filter.Remove(ds.Filter.Length - 1, 1);
>                 ds.Filter += "(sAMAccountName=" + loginName.Trim() +
> "*))";
>             }
>             if (firstName != "")
>             {
>                 ds.Filter = ds.Filter.Remove(ds.Filter.Length - 1, 1);
>                 ds.Filter += "(givenName=" + firstName.Trim() + "*))";
>             }
>             if (lastName != "")
>             {
>                 ds.Filter = ds.Filter.Remove(ds.Filter.Length - 1, 1);
>                 ds.Filter += "(sn=" + lastName.Trim() + "*))";
>             }
>
>             dtSearchUserList.Columns.Clear();
>             dtSearchUserList.Columns.Add(new DataColumn("LoginName",
> typeof(string)));
>             dtSearchUserList.Columns.Add(new DataColumn("FirstName",
> typeof(string)));
>             dtSearchUserList.Columns.Add(new DataColumn("LastName",
> typeof(string)));
>
>             foreach (SearchResult sr in ds.FindAll())
>             {
>                 DataRow row = dtSearchUserList.NewRow();
>                 string name = sr.Properties["Name"][0].ToString();
>                 string firstname = "";
>                 string lastname = "";
>
>                 if (name.Length == 0)
>                 {
>                     firstname = "";
>                     lastname = "";
>                 }
>                 else if (name.IndexOf(",") != -1)
>                 {
>                     iActualLength = name.Length;
>                     iLength = name.IndexOf(",") + 2;
>
>                     if (iActualLength < iLength)
>                     {
>                         firstname = "";
>                         lastname = name;
>                     }
>                     else
>                     {
>                         firstname = name.Substring(name.IndexOf(",") +
> 2);
>                         lastname = name.Substring(0,
> name.IndexOf(","));
>                     }
>                 }
>                 else if (name.IndexOf(" ") != -1)
>                 {
>                     iActualLength = name.Length;
>                     iLength = name.IndexOf(" ") + 1;
>
>                     if (iActualLength < iLength)
>                     {
>                         firstname = "";
>                         lastname = name;
>                     }
>                     else
>                     {
>                         lastname = name.Substring(name.IndexOf(" ") +
> 1);
>                         firstname = name.Substring(0, name.IndexOf("
> "));
>                     }
>                 }
>                 else
>                 {
>                     firstname = "";
>                     lastname = name;
>                 }
>                 row["FirstName"] = firstname.Replace("'", "");
>                 row["LastName"] = lastname.Replace("'", "");
>                 row["LoginName"] = sr.Properties["SamAccountName"]
> [0].ToString();
>                 dtSearchUserList.Rows.Add(row);
>             }
>
>             if (dtSearchUserList != null &&
> dtSearchUserList.Rows.Count > 0)
>             {
>                 dtSearchUserList.DefaultView.Sort = "LoginName ASC,
> FirstName ASC, LastName ASC";
>                 dgADUserList.DataSource = dtSearchUserList;
>                 dgADUserList.DataBind();
>                 blSUSearchSucess = true;
>                 lblSUErrorText.Text = "";
>             }
>             else
>             {
>                 dtSearchUserList.Columns.Clear();
>                 dtSearchUserList.Columns.Add(new DataColumn("Select",
> typeof(string)));
>                 dtSearchUserList.Columns.Add(new
> DataColumn("LoginName", typeof(string)));
>                 dtSearchUserList.Columns.Add(new
> DataColumn("FirstName", typeof(string)));
>                 dtSearchUserList.Columns.Add(new
> DataColumn("LastName", typeof(string)));
>                 dgADUserList.DataSource = dtSearchUserList;
>                 dgADUserList.DataBind();
>                 lblSUErrorText.Text = ErrorLog.GetText("NoUsers");
>                 blSUSearchSucess = false;
>             }
>         }
>         catch (Exception ex)
>         {
>             blSUSearchSucess = false;
>             TraceSUError.Log("\nAn error occurred while fetching user
> details.\nException occurred : " + ex.Message);
>             strURL = "ErrorPage.aspx?strErrPageName=SearchUsers.aspx";
>             Response.Redirect(strURL, false);
>         }
>
>         return blSUSearchSucess;
>     }
>
> Also you can check login user details,
>
> IIdentity WinId = HttpContext.Current.User.Identity;
>                 WindowsIdentity wi = (WindowsIdentity)WinId;
>
>                 strDCHLoginID = wi.Name.Split('\\')[1];
>                 hidDHLoginID.Value = wi.Name.Split('\\')
> [1];
>
>                 if (ValidLoginUserData(strDCHLoginID)) //check user is
> present in Database
>
> Regards,
> Abhijit B
>
> On May 7, 12:59 pm, "Jon" <rosenb...@mainstreams.com> wrote:
>
>
>
> > I am modifying an app for a customer in ASP.Net 1.1. The app is running on
> > a
> > server outside their network, yet they want to authenticate users against
> > their internal active directory set up (they will open the necessary
> > ports).
>
> > So, I have a simple login page with username and password, and then I will
> > authenticate that credentials entered against their AD server. I am having
> > a
> > real hard time figuring this out. We can't use Windows Forms Auth, so I
> > need
> > to do it all manually in code.
>
> > On the System.DirectoryServices namespace I can't find what methods I need
> > to connect to their AD using SSL and then to authenticate the user. I've
> > found a lot online using Forms Auth and ADAM, but nothing has really fit
> > what I'm doing.
>
> > Could anyone point me to a tutorial or outline what methods, etc I need to
> > use to accomplish this?
>
> > Thank you so much!
> > Jon- Hide quoted text -
>
> - Show quoted text -






==============================================================================
TOPIC: Copy Web site vs Publish Website vs Web Deployment Project
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/17773ad5958bc84a?hl=en
==============================================================================

== 1 of 4 ==
Date: Thurs, May 8 2008 9:57 am
From: "Cirene"


If i just do a simple Copy Website will this pose a security risk, such as
people being able to see my code in the vb files?

"Cirene" <cirene@nowhere.com> wrote in message
news:er232COsIHA.4876@TK2MSFTNGP02.phx.gbl...
> When would I use "Copy Web site" over "Publish Website" or visa versa?
> Why would I use the Web Deployment Project vs these options?
>
> I want to make sure no one can pull up/read/download my vb source code (in
> .vb files).
>
> I would prefer easy update of the site (code or aspx.)
>
> Thanks.
>






== 2 of 4 ==
Date: Thurs, May 8 2008 10:32 am
From: "Juan T. Llibre"


re:
!> I want to make sure no one can pull up/read/download my vb source code (in .vb files)

The best way to prevent that possibility is to compile your classes
into assemblies and uploading the dlls to the app's bin directory.

No vb source uploaded = no one can pull up/read/download your vb source code in .vb files.

Make sure that the .Net Framework directory(where the vb and/or cs compilers are located)
is in your path; navigate to the dir where your .vb files are, and run the compile command :

vbc /t:library /out:myFile.dll myFile.vb

myFile.dll will be created/compiled in the current directory.

Move the assembly to the /bin directory of your application and fire away.
If you want to have VS.NET use it, reference it in your project.

If you want to use C#, then the command line would be :

csc /t:library /out:myFile.dll myFile.cs

If you need to import .Net classes, include them in your command line:

vbc /t:library /r:system.dll /r:system.web.dll /out:common.dll common.vb
csc /t:library /r:system.data.dll /r:system.web.dll /out:common.dll common.cs




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Cirene" <cirene@nowhere.com> wrote in message news:er232COsIHA.4876@TK2MSFTNGP02.phx.gbl...
> When would I use "Copy Web site" over "Publish Website" or visa versa?  Why would I use the Web Deployment Project vs
> these options?
>
> I want to make sure no one can pull up/read/download my vb source code (in .vb files).
>
> I would prefer easy update of the site (code or aspx.)
>
> Thanks.
>







== 3 of 4 ==
Date: Thurs, May 8 2008 10:49 am
From: "gerry"


the only people who would have access to the 'code' of your website would be
people who have access to login to the server and permissions to access
those files - unless your IIS configuration is messed up.

The way we do it is,  use a WDP to compile a web site - usually pre-compiled
, non-updateable - to a local deployment folder , customizing the result as
necessary.
Then we have a second solution that includes the local deployment folder as
a web site.
From there we use CopyWebSite to actually deploy to the final destination -
CopyWebSite allows you to pick and choose what gets copied and what doesn't.
We never use Publish WebSite site - which imo is only useful for a 1st time
publish and useless for updates due to its destructive all-or-nothing
nature.

We use this same type of scenario for non-web app updates as well - use
build actions to copy appropriate files to a deployment folder after build.
Open the deployment folder as a website and use CopyWebSite to update
existing installations.

Gerry





"Cirene" <cirene@nowhere.com> wrote in message
news:u$M$WySsIHA.4376@TK2MSFTNGP06.phx.gbl...
> If i just do a simple Copy Website will this pose a security risk, such as
> people being able to see my code in the vb files?
>
> "Cirene" <cirene@nowhere.com> wrote in message
> news:er232COsIHA.4876@TK2MSFTNGP02.phx.gbl...
>> When would I use "Copy Web site" over "Publish Website" or visa versa?
>> Why would I use the Web Deployment Project vs these options?
>>
>> I want to make sure no one can pull up/read/download my vb source code
>> (in .vb files).
>>
>> I would prefer easy update of the site (code or aspx.)
>>
>> Thanks.
>>
>
>






== 4 of 4 ==
Date: Thurs, May 8 2008 10:58 am
From: "Cirene"


Thanks!
"gerry" <germ@newsgroup.nospam> wrote in message
news:u8y$ZPTsIHA.524@TK2MSFTNGP05.phx.gbl...
> the only people who would have access to the 'code' of your website would
> be people who have access to login to the server and permissions to access
> those files - unless your IIS configuration is messed up.
>
> The way we do it is,  use a WDP to compile a web site - usually
> pre-compiled , non-updateable - to a local deployment folder , customizing
> the result as necessary.
> Then we have a second solution that includes the local deployment folder
> as a web site.
> From there we use CopyWebSite to actually deploy to the final
> destination - CopyWebSite allows you to pick and choose what gets copied
> and what doesn't.
> We never use Publish WebSite site - which imo is only useful for a 1st
> time publish and useless for updates due to its destructive all-or-nothing
> nature.
>
> We use this same type of scenario for non-web app updates as well - use
> build actions to copy appropriate files to a deployment folder after
> build.
> Open the deployment folder as a website and use CopyWebSite to update
> existing installations.
>
> Gerry
>
>
>
>
>
> "Cirene" <cirene@nowhere.com> wrote in message
> news:u$M$WySsIHA.4376@TK2MSFTNGP06.phx.gbl...
>> If i just do a simple Copy Website will this pose a security risk, such
>> as people being able to see my code in the vb files?
>>
>> "Cirene" <cirene@nowhere.com> wrote in message
>> news:er232COsIHA.4876@TK2MSFTNGP02.phx.gbl...
>>> When would I use "Copy Web site" over "Publish Website" or visa versa?
>>> Why would I use the Web Deployment Project vs these options?
>>>
>>> I want to make sure no one can pull up/read/download my vb source code
>>> (in .vb files).
>>>
>>> I would prefer easy update of the site (code or aspx.)
>>>
>>> Thanks.
>>>
>>
>>
>
>







==============================================================================
TOPIC: FormViewList?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/1232244307d40b65?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 10:19 am
From: etam


On 8 Maj, 09:58, etam <odwrot...@gmail.com> wrote:
> Hi,
>
> I like FormView for its flexibility. Is there something for displaying
> list of FormViews? If not what is the best way to show dynamic number
> of FormViews?
>
> Thanks in advance,
> Etam.

OK,

found Repeater, sorry ;).

Please.





==============================================================================
TOPIC: Javascript file won't work with RegisterClientScript
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/4651d5020670131d?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 10:50 am
From: "Matthew Wells"


Hello,

   I'm developing an asp.net 2.0 project using VS 2005 on XP sp2 with all
the updates.  I have an aspx page with javascript that works fine until I
try to separate the script into a .js file.  I've found that only the script
that is called from events set in the aspx.cs file don't work.  I eliminated
all script except two functions.  One is used with the .cs file and the
other one is not.

First, here's the functino used with the .cs file:
if (!this.IsPostBack)
{

btnFirst.OnClientClick = "return btnFirst_Click()";

}
... the javascript function is...


function btnFirst_Click()

{

alert("This is btnFirst_Click"):

return false;

}

Now the second javascript function is only

function ShowAlert()
{
   alert("This is ShowAlert");
   return false;
}

This function is called from another button - button1 - from the
OnClientClick event which I set in the property page..

When I have all the javascript in the aspx page, it all wokrs, but when I
move it to a .js file, the first function doesn't work, but the second one
does.

I don't want to add all my javascript in rhe .cs file because that would
expose all my code - that's why I'm teying to put it in a .js file.

How can I make all the code work using both methods?


Thanks.
--
Matthew.Wells
Matthew.Wells@FirstByte.net







==============================================================================
TOPIC: IIS on Vista home premium?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/a1b8eb0511b6db3c?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, May 8 2008 11:25 am
From: pativ


I'm getting an Default Web Server Error  Http 500.0 - can anyone help me?
"Juan T. Llibre" wrote:

> re:
> !> I installed IIS 6.0 on my Windows Vista Home Premium
>
> Bad move...
>
> To install IIS7 on Vista Home Premium, follow these instructions :
>
> http://technet2.microsoft.com/windowsserver2008/en/library/86026b03-18b0-4c42-9884-5af83226e2bd1033.mspx?mfr=true
>
>
>
>
> Juan T. Llibre, asp.net MVP
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ======================================
> "DennisX" <DennisX@discussions.microsoft.com> wrote in message
> news:9886CA43-814A-499D-B688-D7C681331EA4@microsoft.com...
> >
> >
> > "Steven Spits" wrote:
> >
> >> "Juan T. Llibre" wrote:
> >>
> >> > The original question was whether IIS could be *installed* on Vista Home
> >> > Premium.
> >> > IIS, and all of its features, *can* be installed.
> >> >
> >> > Some features may, or may not, work in specific OS's, though.
> >>
> >> Thank you, you made it clear for me.
> >>
> >> Steven
> >>
> >> - - -
> >>
> >>
> >>
> > I installed IIS 6.0 on my Windows Vista Home Premium and I cannot use CSS or
> > User Controls. I would install 7.0, but I don't know how or where to enter
> > the script that gets the full install.
>
>
>




==============================================================================

You received this message because you are subscribed to the Google Groups "microsoft.public.dotnet.framework.aspnet"
group.

To post to this group, visit http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet?hl=en

To unsubscribe from this group, send email to microsoft.public.dotnet.framework.aspnet-unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com?hl=en
 

No comments: