Objects in this mirror are closer to Microsoft Technologies. DNM objective is to help users on Microsoft technologies by providing Articles, snippets, Interview Questions.
Showing posts with label ErrSol. Show all posts
Showing posts with label ErrSol. Show all posts

12 September 2012

javascript not setting the hidden field value in ASP.NET


Today when i tried to change the value of hidden filed in java script, its not setting the value. I am using master page for an ASPX page.



<asp:HiddenField ID="hdnTest" runat="server" Value="Before JS Call" />



In java script method, when I try to assign the value it’s not getting replaced with new value.




document.getElementById('<%=hdnTest.ClientID%>').value = 'After JS Call';

then i replaced with below code

document.getElementById('ContentPlaceHolder1_
hdnTest').value = 'After JS Call';


and it worked out.

Not sure with the reason but its resolved!

25 July 2012

windows service is not listing in attach to process window in Visual studio

You have registered your windows service in the services.msc and its running successfully. When the service is running it shows in the task manager.

Err:
If you want debug the window service code, few times it will not show in available process under attach to process window from debugger.
The root cause could be your service is running under local service or system account not by your user account. In Attach to process window, by default the available process will show the processes which are running under your account name.
So in order to resolve the issue please do the following step.
Sol:
Make sure that you are running the visual studio as an administrator and from the attach process window (Debug à Attach to Process) select the checkbox ‘show process from all users’ in the available process section.
Note: If you have small piece of code in Onstart method. By the time you have attached the service the code execution might complete so try to add code Thread.Sleep(3000).