Change the default path of ASP.net website - asp.net

When debugging my current solution, it always output to mylocalhost:port/default.aspx. How to I force it to output to another path like mylocalhost:port/Default/default.aspx?

right click on your project select properties (or press F4) and you can change port number, and virtual path like \default

You need to change it in your web application's settings (right click project and choose Settings from menu or Alt + Enter), like this:

Related

2sxc - How To create toolbar button to open custom CSHTML

If I want to create a button for template-editor I am using this code:
#Edit.Toolbar(actions: "template-develop")
But in my template code I also use code like this:
#RenderPage("_pager.cshtml", new { count = data.pCount, active = data.pActive})
And if I want to edit this file: _pager.cshtml I have to go to the server with FTP or RDP and change this file...
Can I and how create "template-editor" button for _pager.cshtml that I can edit it inside web browser?
Wonder why you need to open it through FTP or RDP as you can edit it directly from website by clicking the template name :

Visual Studio Extention - Context Menu for 'Server Explorer'

In a VSIX project, in the .vsct file I can see how to target different objects and provide a custom context menu:
For instance, the following will target an item node in the solution explorer:
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/>
<!--<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>-->
</Group>
Changing the id property from IDM_VS_CTXT_ITEMNODE to IDM_VS_CTXT_CODEWIN will result in the context menu appearing in the code window instead.
This is documented here:
Microsoft Documentation
However, I would like my context menu to appear in the 'Server Explorer' instead. An example and a link to the documentation would be very helpful.
To find Visual Studio menu guids, this usually works.
In your registry set EnableVSIPLogging DWORD to 1, under HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\General.
Restart Visual Studio (and computer?) and hold Ctrl+Shift and right click an item in the server explorer, it will open a dialog window with something like this:
You can go from there.
Thanks to Paul Swetz and James Sinclair I was able to get this working.
Using the method described by Paul Swetz I could identify the guid required for the Server Window object I was clicking, in this case the table node.
Having got that I added that id to the Symbols in the .vsct file, with a name of my choice:
<GuidSymbol name="guidWhatever" value="{d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2}"> <!--//server explorer - table-->
<IDSymbol name="IDMX_DV_OBJECT_NODE" value="0x8200"/>
</GuidSymbol>
Now I can use that in Groups and the custom command appears in the dropdown.
<Groups>
<Group guid="guidFirstCommandPackageCmdSet" id="MyMenuGroup" priority="0x0600">
<!--<Parent guid="{D309F791-903F-11D0-9EFC-00A0C911004F}" id="IDM_VS_CTXT_ITEMNODE"/>-->
<Parent guid="guidWhatever" id="IDMX_DV_OBJECT_NODE"/>
</Group>
</Groups>
The only problem now is identifying and accessing the selected table and database but that's another matter.
All of VS 2015's commands, menus, toolbars etc are detailed in a couple of c++ header files (stdidcmd.h and vsshlids.h).
On my install they are in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\VisualStudioIntegration\Common\Inc'.
Had a very brief look in the files and i think you'll need something starting
IDG_SE_CONTEXT_ to target groups within the server explorer context menu
IDG_SE_TOOLBAR_ to get into the toolbar
IDM_SE_CONTEXT_ to get to the context menu
IDM_SE_TOOLBAR_ to get to the toolbar menu

asp.net image tag displays image only in visual studio debugging mode

I'd like to compile and deploy a finished image that will efficiently display the image I've set up in the following line:
imgtag.ImageUrl = "..\..\Images\IMG_Temp\" & "PVATmp" & Trim(CStr(mlnk)) & ".jpg"
This line displays the image smoothly and quickly in the designer when I debug, but not after the program is compiled and displayed on an IIS Web server instance. For one thing, the image is displayed on a postback in designer, but that condition in the deployed version cannot show the image. I have to refresh the page.
Any ideas?
The path the image is displayed from is relative. ..\..Means you are moving 2 levels up from where you are now. "where you are now" likely means something different while debugging than it does when deployed.
Also, does your variable mlnk have a value?
Try to use like this:
imgtag.ImageUrl = Server.MapPath("~/Images/IMG_TEMP/PVATmp" + Trim(CStr(mlnk)) + ".jpg";
This is in case when you IMAGES folder is located in the root path

how to make a VisualBasic2010 web app open a new browser window for a .htm file

On my web app's home page, when the user clicks the "About" hyperlink control (System.Web.UI.WebControls.HyperLink in my default.aspx), I need another browser window to open containing an existing about.htm file.
There are other hyperlinks for "Purpose" and "Description" and "How to" and I would like each to open another browser, so that the user can refer to these while performing operations.
You should place the following code in page_l;oad event,
Hyperlink1.Attributes.Add("target","_blank")
or
you can directly change the target property of a hyperlink control to _blank
This will open the the link in new browser window.
System.Web.UI.WebControls.HyperLink have a Target property that needs to be set with _blank value as shown on example at http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hyperlink.target.aspx
Hope this helps...

GWT: FileUpload Browse Button styling

I need to style the browse button of file upload in GWT.... I found the way through this link http://www.dreamincode.net/forums/topic/15621-styling-a-file-browse-button/. But I am not able to use the same in GWT. Any idea how to go about it?.
I am using GWT 2.4.0
I tried the following approach and it worked for me.
I hid the file upload field and used a trigger box on the screen instead. Trigger box click is delegated back to file upload browse button click using JSNI approach
private static native void fileClick (Element el) /*-{
el.click();
}*-/;
And used the fileupload.getfilename() and set the trigger text box with file location details.

Resources