Controling Tab page changes Winforms - c#

I am building a .Net 3.5 WinForms based questionnaire comprising 9 steps (each on a tab page using a TabControl control). I would like users to move to the next tab ONLY when they click a "Next Step" button I've provided and not jump to later steps by clicking on the tab buttons above.
Basically, I dont want them to see contents of later steps/tab pages without completing the current step/tab page they are on, and then clicking my "Next Step" button.
Any ideas would be appreciated. Cheers.

you can create your tabe pages and remove all pages except first page by
Like
tabControl1.TabPages.Remove(tabPage2);
.
.
.
tabControl1.TabPages.Remove(tabPageN);
and after each click of next button
add proper page (may be next page ) to tabecontrol
tabControl1.TabPages.Add(tabPage2);
and
tabControl1.TabPages.Add(tabPage3);

Related

Xamarin, send data between classes

These are my tabbed page.
If I click on the GÖNDER button, I'm going to the SONUÇ page.
When I open the program, my % value in my SONUÇ page is opening %0 by default. I need a set of actions. But the master-detail page opens automatically when the program is opened.
When I click on the GÖNDER button, the % VALUE on the SONUÇ page changes but I can not show because I can not Reload.
How can I reload or refresh when my SONUÇ page changes % value?
Might be in this case MessagingCenter concept will useful for you in xamarin.forms
Reference link:
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/messaging-center/

Simulate clicks in webrowser

how would I go about clicking a button ina web page loaded in the webbrowser component? I want to click a button and display the resulting page in the webbrowser. I have googled and can not find the answer; can anyone help?
If the element has an ID, you can use this;
webBrowser1.Document.GetElementById("id").InvokeMember("click");
Although one direction I used recently is to find out the url that the button click takes you too, and navigate to that. This may not work for all sites..

html: perform other actions after following a href link

Background
Here's what I want to happen:
A user is on one page1.html (jsFiddle).
When they click on one of the <a href...> links, I want to navigate to page2.html (jsFiddle) and simulate the user entering the number into the textbox and clicking on the button.
Example: On page1.html, user clicks on display 2. Then we will navigate to page2.html and get an alert of 2 (as if user had entered 2 and clicked the button).
Question
How do I do this?
Is there a way to make a C# method with a specific URL to navigate to, such as page2.html/searchfor/2?
Or is there some way in JavaScript to manually go about doing other things after navigating to <a href="page2.html">?
Things I've tried
Using a <span> with an onclick function, but then it's not a true link like <a href> where I can middle click to open in new tab and right click to follow link
Wrapping my first attempt in <a href> tags, like <span>Display 2</span>. This still doesn't solve the problem of performing extra actions after navigation.
Note
I am building this webpage using Entity Framework, ASP.NET MVC, and C#.
I have simplified the problem for discussion purposes, but the concept is the same.
Try using the page2.html document's onload() function. You can pass parameters through the URL, then take that data and perform "other actions" as soon as the document is loaded.

How to close current Browser window and redirect to a previously opened window for the same browser

i have two asp page,first one is home and second one is test. In home page user can select the type of test they want to take up, and after pressing start button a new window is open for taking the test. What i want to achieve is , after completing the test i want to close the test window and redirect to another page, and this redirect should hit the previously opened home window.
You don't clarify that you have popup window or blank window i am aspecting for the popup
In submit click button press
String x = "<script type='text/javascript'>window.opener.location.href='**Your new url of new page after completing test**';self.close();</script>";
ScriptManager.RegisterClientScriptBlock(this.Page,this.Page.GetType(), "script", x,false);
From self close you will be able to close current window and by window.opener.location.href you will able to redirect to new url
I hope this will help you
regards....:)
Yes you can do these 2 ways:
Window.Open() /.showmodalDialog() and keep parent and child open as well, or
On the home page click on your start button. Use code Response.Redirect("~/Test.aspx"); assuming it resides with Home.aspx. Take your test using ASp.Net wizard control or hiddens divs what ever suits you easy. Manipulate data on test page , save and get result to and from database using SqlConnection and SqlCommand assuming you have Sql Server as backend. Hold the table or any value in either cache or Session and throw it on your home page. Do whatever you want.
This will be not possible. What you can do is to redirect the user to the home page after completing the test, but this will be in the same windows.

ASP.NET Page loads slow as a popup, but not standalone link

Got a strange one, here.
I'm working on a basic ASP.NET/C# code-behind app where summary data is listed in a grid, and each record has an accompanying "update" button. Clicking the button triggers a window.open() where the ID for each row of the grid is passed into a query string to retrieve the related record for edit in the new window.
Example from the rendered "grid" page:
window.open('EditTool.aspx?ID=' + ID, 'new_window', width=550, height=300');
When the page opens from the button, it can take upwards of 10 seconds to render. When I open a new tab and just paste the URL and query string content into the address bar, the page renders almost immediately.
I've peppered the content of the page with log4net statements, and it looks like all of the controls and code-behind C# executes in a few milliseconds.
For investigation's sake, I've got popup blockers deactivated, and I've tried this on IE7 (workplace standard, ugh), FF, and Chrome.
Any ideas as to how to make the rendering faster, or where else I can look to see what's slowing it down?
Update:
I've created a new shell webapp that has a button opening an empty (just the stuff that gets added when you "Add New Item") ASPX as a popup. The popup renders immediately. I've also modified my existing app to open an empty popup, and I get the same delay. It's looking like the app server is waiting to process something before it starts processing the page, rather than rendering the page, slowly.
Does ASP.NET have a setting where you can tell it not to recompile a page on each render?

Categories