.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Directory structure problem

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net


         I m sure this question has been asked before. I have a web application hosted under http://localhost/abc. which is mapped to c:\inetput\wwwroot\abc folder. I have APP_Code, App_LocalResources, BIN and other folders under abc folder. Everything is great. Now I want to create another application or sub application http://localhost/def. Both abc and def apps need to use some common classes and resources. Whats the best way to do it. I dont need to create a separate application for def. All i want is the url http://localhost/def.





View Complete Post

More Related Resource Links

problem with banner s structure

 Hello everyone,   Last night I was watching the banner of the first page of this website I mean this address http://www.asp.net/ and when I save background of that (I mean the blue part)I could not understood how it was made could you please help me to understand how I can do that?

Problem with ChangePassword in Active Directory

Hi, i'm having a problem trying to change the password in AD. I'm developing using c# 3.5. This is my code (i have omitted some lines for brevity): String server = txtServer.Text; String container = String.IsNullOrEmpty(txtContainer.Text) ? null : txtContainer.Text; String login = txtUser.Text; String password = txtPassword.Text; String userToManage = txtUserToManage.Text; String oldPassword = txtOldPassword.Text; String newPassword = txtNewPassword.Text; using (PrincipalContext context = new PrincipalContext(ContextType.Domain, server, container, login, password)) { using (UserPrincipal user = UserPrincipal.FindByIdentity(context, userToManage)) { if (user == null) return; if (user != null) { user.ChangePassword(oldPassword, newPassword); user.Save(context); } } } If i run this code on a computer in our Domain, all is fine. But if i run the code on our customer's computer, i receive this error: Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied (exception from HRESULT: 0x80070547) The only way to make the code run correctly is to run our program under a user with more privileges then a normal user. That is, if the user logged on the computer is a normal user, our customer receives the error. But if he uses a more "powerfull" user to

I cannot see directory structure from windows explorer


When I do start > run \\servername I used to be able to see all subsites and libraries.

Now I get a blank windows explorer window.  My sysadmin claims he didn't do anything.

Any ideas?

Problem marshalling the following structure



I'm experiencing a problem in c# tryin to marshall a pointer to a structure inside another structure

I'm trying to call the following function hosted in a C++ library:

HRESULT GetNextRow(MYUSERDATA *userdata);

typedef struct _LDAPATTRIBUTE
  WCHAR attributeName[520];
  WCHAR attributeValue[520];

typedef struct _MYUSERDATA
  WCHAR objectGUID[80];
  WCHAR distinguishedName[520];
  PLDAPATTRIBUTE attributesList;

In C#, I have created the following definition:


    const int MAX_PATH = 260 * 2;
    const int MAX_OBJECTGUID = 40 * 2;

    [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
    public struct LDAPATTRIBUTE
      /// WCHAR[520]
      [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]

Problem when I create directory mapping


Hi all.

I have many  users in my website and I need to get a private page to one by one users.

Now I can't  create physival private page for one by one users and I need to create directory mapping to load users details on my website.

To load usres details on myweb site I must get  username of user from querystring EXP. "http://www.mysitename.com/username" and start to view user details on privatepage.aspx. The privatepage.aspx is handler users details of myweb site for users. For getting username from the querystring I need your help.

I trid very much to get username of user from querystring but I was unsuccessful to do this.

If somebody of my friends can help me. please send a post to me.

Best Regards.

Problem With space When updating password of active directory users from asp.net


Hello Friend's

From long time i am facing problem with Reseting password of users of active directory from asp.net.

The coding is work fine when there are no space in username but it's cause a problem when there are space in username.


usernametochange = "Ketan Patel";
                       ds.Filter = "(&(objectClass=user)(sAMAccountName=(" + usernametochange + ")))";
                       ds.PageSize = 100;

                       SearchResult account = ds.FindOne();
                       DirectoryEntry user = account.GetDirectoryEntry();
                       object[] oPassword = new object[] { "krtya#123" };

                           object ret = user.Invoke("SetPassword", oPassword);

if you have any idea about it please help me.

Thank you.....

Problem Import Pictures into User Profiles from Active Directory


I have problems with getting the pictures from Active Directory (Field "thumbnail Photo") into my Sharepoint User Profile Store and displaying it in the MySites.

Profile Synchronization is working fine, the field Picture is mapped to thumbnailPhoto.

Then for finishing the process I execute the following powershell command: 

Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation "http://mysite.vz.ch/my"

I execute this command under the user context from the account which has all the necessary AD-Rights. I do this with "start-job -Credentials $cred -ScriptBlock $sb" where -Credentials for the AD Sync Account and $sb for the above Powershell Script (Update-SPProfile....).

For this I had to give rights to the sync account on the user profile service application (administrator and permission button, I know). Also I had to give "db-owner"rights on the Configuration Database and also on the MySite Database for this sync account. I found this out via ULSLogViewer.

Now it is working as far that the scripts enumerates all user profiles and tries to process the images. But in ULSLogViewer I have the following error message:

"Error processing the photo URL User Photos/Profile Pictures/0c37852b-34d0-418e-91c6-2ac25af4be5b_652.jpg for user ZH01\BEr: System.U

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

Difference Btw Website vs Web application and Virtual directory in IIS 7


May i know what is the Differenc that they actually make in IIS7 .

Please tell me at a low level as i am still a novice in Asp.Net


Thanks in Advance.


ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

Could some one tell me whats the Problem with this String Manipulation ??? C#.net



I store some values from code behind to a label which is Hidden !

<asp:Label ID="lbl_Hidden" runat="server" Visible = "false"></asp:Label>

and at the page load event i retrieve the value of the label & assign it to a string !

stringvalue = lbl_Hidden.Text;

Now i dont know why this manipulation does'nt work !

I've a character 'A' in the string and i'm unable to replace it with a space !

stringvalue.Replace(A, " ");

Wot do u think abt it ????

Browsing all Images in Directory ... ?! asp.net & C#


Hi every one ... How are you ??

OK ... I want to make album ... I try to make it using buttons( next & pre ) using imageButton control and variable (i)

So ... each next (++i) & pre ( --i) to show allimages in directory ("photo")

Here my code in C#  ::

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.IO;
using System.Collections.Generic;

namespace iThinkerWebSite
    public partial class photos : System.Web.UI.Page

       // LinkedList<string> names = admin.getNames();
        DirectoryInfo dir;
        FileInfo[] files;
        static int i = -1;
        static int l = 0;

        protected void Page_Load(object sender, EventArgs e)
            dir = new DirectoryInfo(MapPath("photo"));
            files = dir.GetFiles();
            //l = (int)names.LongCount();
            l = files.Length;
            if (l == 0)
                Label2.Text = "No Photo to Display !!";
            Image2.ImageUrl = "images/ith.png";
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend