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 :
Related
I want to create a button in a googlesheet/google Apps Script that opens an existing google sheet in a new tab when u click on it. I will insert the button in a google sheet, so i basically just need a code that i link to the button.
The code below does not work somehow?
Can you help me?
function openURL(){
var button = CardService.newTextButton()
.setText("This button opens a link in an overlay window")
.setOpenLink(CardService.newOpenLink()
.setUrl("google sheet")
.setOpenAs(CardService.OpenAs.OVERLAY)
.setOnClose(CardService.OnClose.RELOAD_ADD_ON));
};
In order to create such button and functionality, you will have to:
Create the code that will be executed upon clicking it. Go to Tools>Script Editor. Paste the following code (replacing, of course, the url for the appropriate one):
function openMySpreadsheet() {
var url = 'YOUR_SHEET_URL';
var htmlTemplate = HtmlService.createTemplateFromFile('js');
htmlTemplate.url = url;
SpreadsheetApp.getUi().showModalDialog(htmlTemplate.evaluate().setHeight(10).setWidth(100), 'Opening Sheet...');
}
Still from the Google Apps Script IDE, go to File>New>HTML File. Set the file name to be js and paste the following code into it:
<script>
window.open('<?=url?>', '_blank', 'width=800, height=600');
google.script.host.close();
</script>
Go back to your Sheets document and insert an image using Insert>Image>Image over cells and select any image you would like to have as your button.
Select the newly created image and click on the 3 dots that appear on the top-right corner of it. Click on "Assign script", and put the function name to be run (in this case, openMySpreadsheet would work).
From now on, each time you click on the button, a short-lived dialog will be shown up (that is necessary in order to open a link on a new tab) and the link will be automatically open.
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:
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...
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.
i want select folder using asp.net , when i click browse button it will open file selection dialog.
There is no html control for folder selection - so this is not possible with ASP.Net.
You Can Add:
1- Folder Browser Dialog (For Folder)
and use it Like This:
`if(folderBrowserDialog1.ShowDialog() != DialogResult.Cancel)
string str = DialogFolderBrows.SelectedPath;`
2- Open File Dialog (For File)
and use it Like This:
`if(openFileDialog1.ShowDialog() != DialogResult.Cancel)
string str = DialogOpenFile.FileName;`