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

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

Internal Network Problem/Confusion.

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :.NET Framework
I have a DLink Router and a small server running on port 80. From a different PC I can access the PC via a web browser and even from outside my house I set the server up to be accessed and can do so. BUT from my code on my PC FAILS .. HttpWebRequest   myHttpWebRequest = (HttpWebRequest)WebRequest.Create(myurl); WebResponse myHttpWebResponse = (WebResponse)myHttpWebRequest.GetResponse(); I can copy the text of myurl and put it into a browser on the same laptop I am coding with and it returns the text data as it should from my application. I am totally confused.. I am using an internal IP of 192.168.1.xx and it JUST doesnt work.. If I try to hit the external IP that really doesnt work. HELP?? I could use some..  bfxtech.com

View Complete Post

More Related Resource Links

MVC application problem when running out of Network Service.



I am hosting an ASP.NET MVC 2 application on its own application pool.

Everything works fine if the application pool is running on Network Service with Full Control.

If I make the application pool to run on its application pool identity, even with full control, the web site runs ok but on every page with a form I get the following error:

"Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster."

Any idea how to solve this problem?

Thank You,


Problem adding Sharepoint Web Share to My Network Places (Help Please!)


I'm having a unique problem I think... I've googled this every which way I could think of but haven't seen anyone have the same problem.

Here is what is happening. I have a client uses My Network Places and have created sharepoint webshare "shortcuts" in my network places. However on one particular computer instead of it creating a webshare it is creating a UNC shortcut.

What I am doing is the following.

1) Open My Network Places

2) Click the Add a Network Place

3) Choose the option for "Another network location or website"

4) I enter the URL of the webserver: Http://webserver/development (copied directly from IE)

5) I confirm the name and finish.

Here is the problem. Instead of the shortcut reading as Http://webserver/development it reads as \\webserver\development and has basically converted it to a UNC share. On most of the PC's it creates a folder with a globe icon and when the users go to save or attach files the format is very similar to sharepoint. When this PC attempts to open the shortcut they get your standard windows folder structure.

Has anyone seen this or been able to fix it?


Problem Accessing a Web Service Outside of Local Network


I've created a simple web service and tested it on my local machine and it worked perfectly. Another machine in the same local network tested using the web service and it worked fine as well. However, when I try to access the web service from outside of our local network, it returns a HTTP status 400: Bad Request error message. Any clues as to what might be causing this behavior?

It's my understanding that port 80 is for web services and that is not being blocked by a firewall or anything, so that is not the issue. Any help would be appreciated.

SMO.Backup Problem with Remote Server on Network [SQL Server 2008, VS2010]



The Below codes working fine while I create backup on SQL Server installed on same system. But When I try to take backup on Network, the backup says failure.

Really i can't understand. Just i changed the IP & I tried, but I get failure reply.

For that Any Ideas will be welcome.

 MyDTBaseName = "Supplier_Accounts"
    MyBckPth = "\\Unc_Path\Year_End_2010"
    PurDbName = MyBckPth + "\Sup_SQLSMO.bak"
    Dim MyServIp As String = ", 2745"
    Dim MyRemot_ServIp As String = ", 2745"
    Dim MyBackup As Microsoft.SqlServer.Management.Smo.Backup = New Microsoft.SqlServer.Management.Smo.Backup
    Dim MyServer As Microsoft.SqlServer.Management.Smo.Server = New Microsoft.SqlServer.Management.Smo.Server
    'Dim MyServer As Microsoft.SqlServer.Management.Smo.Server = New Microsoft.SqlServer.Management.Smo.Server(",2745")
    MyServer.ConnectionContext.ServerInstance = MyServIp
    MyServer.ConnectionContext.LoginSecure = False
    MyServer.ConnectionContext.Login = "sa"
    MyServer.ConnectionContext.Password = "123"
    MyBackup.Action = BackupActionType.Database
    MyBackup.Database = "Supplier_Accounts"
    MyBackup.Devices.Add(New BackupDeviceItem(PurDbName, DeviceType.Fi

Gmail internal chat like message box

This article provides you with the multi-functional message box window through which the usability of the web-site or any web application increases.

.Configurable MessageBox window with AJAX Support
.can set maximum number of message boxes to be visible
.can define the auto reload time, for single message, for all messages or no reload
.can create messages through a single function call
.can define auto hide time for each messages

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

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 ????

RaiseEvent problem


I have a parent page ProdView.aspx and two static UserControls, UC1 and UC2. Each UC is in an Ajax accordion pane and the accordion inside an updatepanel.

UC1 has a Gridview footer with couple of textboxes and a link button that fires an Add Row insert procedure. I want to Raise an event that will rebind the UC2 after the row insert in UC1.

First I created the sub delegate and event in UC1:

  • Public Delegate Sub MyRefresh(ByVal sender As Object, ByVal e As CommandEventArgs)
  • Public Event Refresh_UC1 As MyRefresh

In the same UC1 the Insert procedure that fires the insert and RaiseEvent:

Sub PricingGrid_Insert(ByVal sender As System.Object, ByVal e As EventArgs)
       Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString)
       Dim myCom As SqlCommand = New SqlCommand("AddRow", myConn)
       myCom.CommandText = "AddRow"
       myCom.CommandType = CommandType.StoredProcedure


Gridview Enable Selection Problem



I have a gridview with Enable selection and Enable Paging equals to TRUE.

I also set the PageSize of my gridview to 4 so that I only displays 4 rows per page.

The problem is when I click the pager in the bottom of my gridview, my gridview is disappearing and no records appear.

Here is code behind of my gridview:

If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes("style") = "cursor:pointer"

                e.Row.Cells(2).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(3).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(4).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(5).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(6).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))

Problem making Role based Menu in MVC application



 I want to make Rolebase menu in MVC such that if user doesnot have permission for some action then that Action name shouldnot be shown in the Menu.

 I have used the code in the url(http://forums.asp.net/t/1566328.aspx) in my MVC application.My application is a Discussion Forum(in MVC) same functionality as in this forum forums.asp.net

 I have used Controllers for post, thread etc.In each controller there are some actions that are using [Authorize(Roles)] attribute

 but this coding does not count  those Actions in Controllers having Authorize attribute according to the url http://forums.asp.net/t/1566328.aspx 

 In the code, Authorize attribute is applied to Controller class, but my requirement is of Applying Authorize attribute to some actions in controller so that some are available for all users and  some links are available rolewise.Now what is the solution for that?



Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

Embed Youtube inside Ajax Html Editor- problem



When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Roderick Vella

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