Kentico Custom WebPart button on Click event - onclick

I've created a custom webpart to register a new user. I added a button to register and on-click event register I write my code . when I add the web part to kentico it gives my error loading the webpart ,when I remove the on-click event it works fine . How I could solve this and I need to write the code inside the event. thanks

Have you followed the Creating new webparts example in the Kentico documentation? Make sure that your user control inherits from one of the base classes listed there.
It might also help if you paste the error from the Kentico event log, as this may give more of a clue as to what is not working.

Related

How to open multple aspx page one by one on page close event

I am working on ASP.net Web application. I have a aspx page called "print.aspx"
I need to write a logic to load again the same page again on closing of that page (pressing the "close" button of that page.
(attached image)enter image description here
Can you please guide me how can I achieve this ?
I think The best way to use Thread's and implement async method's with await...

ASP.net open new webform on click of button

I am using C# ASP.net, and relative new to it, and need to accomplish below.
In my VS2010 web application project I have default.aspx, form1.aspx with button1 and form2.aspx.
1-I want to set form1 as my home page (the first page that opens when I run app)
2-Want to open form2 when I click button on form1
Also, can you please suggest good book that covers items like above?
thanks
Jay
Quick start would be to double click the "button1" in designer view, which will generate a button1_click(...) event handler. In this routine, you could write one line of code:
Response.Redirect("~/form2.aspx");
To set Form1.aspx to your "homepage", it would make sense to rename it to "default.aspx" which is usally the page IIS looks for to start from.
hope it helps,
When publishing, in the IIS you have to make the default page the form1.aspx page. In your VS2010 just right click on the file and set it as start page.
Yes, the Response.Redirect answer posted is correct.
I've found that ASP.NET Unleashed is really helpful for beginners. You can find it on amazon:
http://www.amazon.com/ASP-NET-4-Unleashed-Stephen-Walther/dp/0672331128

New .aspx page in Visual Studio Web Application crashes page

i'm having a WebPart for displaying information about employees and i want to display only a view information about the persons. The rest should be available after clicken on a "more" link. I tried to get that with opening a "popup"window.
But i don't get that to work right. So i tried using a new page. Hence i added a new aspx page to my project in visual studio
and added a link to that page like that:
LinkButton link = new LinkButton(); link.Width = Unit.Pixel(20);
link.Text = "more";
After building the project i tested it in my webpart page and get an error
"An unexpected error occured".
It took me a lot to get the webpart work properly again.
Has anybody an idea what i'm doing wrong. (i also tried to catch an exception without success)
I also tried to add an click event to that "more" link. but then, when i hover above that link with the mouse i see
"javascript:__doPostBack('ctl00$m$g_84d91faf_d0a8_4587_bb7c_712030d2c4ea$ctl00$ctl18','')"
i tried with link.OnClientClick and link.OnClick, nothing works.
I really need that function for that page.
I would highly appreciate it if you can give me a code snippet of a solution.
Thanks in advance
You should use PostBackUrl property of linkbutton Or on button click event you can call Response.Redirect

using easyslider with asp.net to create a registration wizard

I am trying to make a registration wizard that contains about 6 steps.
I have moved away from using the standard asp.net registration wizard as I want more control over the look and feel.
I am using the easyslider plugin as I want a back and forward button that allows the users to click through the steps and be able to go back and forwards.
So everything was going well until a added an asp.net button into the plug. When I click it the page postback isnt happening, Does the plugin stop the ability to use asp.net controls inside? Is there something else I need to do to enable the click event to fire when using this plugin?
Any advise would be great!
Thank you
Make sure your button is registered properly (eg : with a runat="server") in the aspx file.
Did you try to move that button outside of your wizard ? I never used easyslider but I guess, like most sliders, it "just" hides or shows partial part of the page so I see nothing that could prevent a post back from happening.

How do I build a popup dialog in asp.net

I am building a Web Application using asp.net (C#). I come from windows forms development and find myself in a hard spot. Im making an application where the user should edit some simple information about himself, and thus i need to create a new dialog. How do I do that in asp.net? I have a button which event is handled serverside, and when i click lthis button i want to popup a dialog where i can show my custom web control (or any web control, lets make it generic from the start). How do I go about with doing so?
I got some part of the way by looking at the internet, that i need to make a section and set the z-index to 1000, but how do i make it visible (block)? Please help here as i am completely lost...
/H4mm3rHead
If you're not concerned about using a library, try Microsoft ASP.NET AJAX Control Toolkit, they have several controls that can create something you want (the ModalPopup control).
The AJAX Control Toolkit has a ConfirmButton extender which will do exactly what you are looking for.
I used to do the following:
1. my new pop up is just a new aspx page like any other page
2. add a button (or just a link) that fires a client side java script function
3. in the function I use window.open and put params to open my popup page with no toolbars or scrollbars and proper size to its content
check this for more info on #3

Resources