I am using the code mentioned below to pop up a message.
ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('"+s+"');", true);
This is working fine, but I want to change the title of the window. Presently the title of the pop up window is "the page at localhost says:". But I want to change this. Is there any way through by which I can change the title of the pop up window.
Here it comes
Page.Header.Title = DateTime.Now.ToString();
You can't change the JavaScript alert box header name. But instead you can use one of many existing frameworks. For example jQuery UI Dialog.
Related
I am facing one simple problem-- there is one Add button in the web page, After clicking that a small pop up window (Not in another browser tab , without title) opened having 3 text box. These id/xpath is getting changed whenever will click on Add button. I need to to enter few data and then save.
Could you please help me how we can handle this dynamic xpath/id ---text box in robot selenium framework. Is there any way we can input on text box based on label. Please share any pointer or sample code.
Thank you very much for the help.
I'm making a Master/Details app with Template 10. The Master/Details Template 10 sample uses a CommandBar to get full control over when the back button is shown, but I'd like to show the back button on a PageHeader or on the shell. The problem is, since there is no back stack, the button refuses to be shown. How should I handle this?
Override the OnNavigatedTo event and set AppViewBackButtonVisibility to Visible in the code-behind file for each page that you want to enable the title bar back button.
Take a look here: http://grogansoft.com/blog/?p=1116
The important part is "AppViewBackButtonVisibility"
if (rootFrame.CanGoBack)
{
// Show UI in title bar if opted-in and in-app backstack is not empty.
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
AppViewBackButtonVisibility.Visible;
}
I also suggest you take a look at the AppBar properties.
Especially the Visibility which gets or sets the visibility of a UIElement and you could force the visibility of an item:
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.appbar.aspx
So I've created a hacky solution to this. Basically I'm adding a dummy value onto the stack so that the back button thinks there is something to go back to.
var entry = new PageStackEntry(typeof(bool), null, null);
Frame.BackStack.Insert(0, entry);
Then I've added a BootStrapper.BackRequested event which sets HandledEventArgs.Handled to true so Template10 doesnt actually pop the page. That way I've got full control over the back stack and the back visibility.
I have a single AppBar declared in default.html for use throughout my application.
On some of the pages I need to show the App Bar and in some of the I need to hide the AppBar.
So far, my efforts to find the methods to hide and show the AppBar have met a dead end.
The documentation on MSDN says:
AppBar.hide method :
Hides the app bar on Windows and the secondary command menu on Windows Phone.
So, that method only hides the AppBar for Windows and not for a Windows Phone project.
I have also tried giving display:none as a CSS style, to no effect.
Any help will be appreciated :)
AppBar.Hide hides the secondary command bar on Windows Phone, not the main AppBar. If you want the entire AppBar to go away then this isn't the right property.
The easiest way is to declare the AppBar on pages that you want to show it and to leave it out on pages that you don't want it, but you should be able to hide it by disabling the AppBar on pages that you don't want it on.
I just modified the appbar-commands.js file in the HTML AppBar control sample as follows and the appbar hides and shows as I click the hide and show buttons:
// These functions are used by the scenario to show and hide elements
function doShowItems() {
document.getElementById('commandsAppBar').winControl.disabled = false;
//document.getElementById('commandsAppBar').winControl.showCommands([cmdFavorite, cmdCamera]);
document.getElementById('scenarioShowButtons').disabled = true;
document.getElementById('scenarioHideButtons').disabled = false;
}
function doHideItems() {
document.getElementById('commandsAppBar').winControl.disabled = true;
//document.getElementById('commandsAppBar').winControl.hideCommands([cmdFavorite, cmdCamera]);
document.getElementById('scenarioHideButtons').disabled = true;
document.getElementById('scenarioShowButtons').disabled = false;
}
I also confirmed with the single-page navigation model navigating between two pages. If you aren't seeing the appbar hide and show when disabled and enabled then make sure you are calling the code to disable / enable the appbar. The PageControl's ready function may not be called when returning to a cached page.
You'll have to do it with C#, You can simply just type.. (If your appbar is called ApplicationBar)
ApplicationBar.Visibility = Visibility.Collapsed;
This will instantly hide the AppBar! If you want your HTML Page to perform this action, it will be much complicated.
Cheers
I think you can try below step in your code.
Add a event listener for appbar beforeshow
In code of before show Check a condition with specific page name
Like : if (WinJS.Navigation.location.match("test.html"))
According to you condition you can Disable your appbar.
All the best..!!
I want to change the window title for ActivePivot Live, so that users having multiple Live instances open, can better find the right one.
I've tried calling Window.setTitle from my GinBootstrappers.afterApplicationLoaded method, but that seems to only show for a second or less, before being changed back to "ActivePivot Live"
Found my own answer.
GinBootstrapper.APPLICATION_NAME is public and not final,
so in my Bootstrapper, I can simply add this line to the constructor:
APPLICATION_NAME = "My Application Name";
The window title is set by the application and it is not possible to change it.
I use watir in RadRails IDE. I need to attach a new window by it's title, but in my web application there could be an error, the title is missed. So I can't use the code:
ie3=Watir::IE.attach(:title, 'Mt Title').
The page is loaded and I can perform some actions there. Is there way to focus on that window not using page title? Or how can I define page title?
Maybe there is a possibility of choosing a window by name or some other attribute and if I do not know the exact name then can I define it or define names of all opened windows?
If there is only one IE window this would work:
browser = Watir::Browser.attach(:title, //)
If you want to check if there is a page with a title, try something like this:
begin
browser = Watir::Browser.attach(:title, "teh codez")
rescue Watir::Exception::NoMatchingWindowFoundException
puts "could not find browser"
end