|
Button Click
Varun Arora,
Software Engineer,
Knowledge Calls,
Gurgaon, India
|
|
|
|
|
You can do like this.
this will be there in codebehind page.
Button1.Attributes.Add( "onclick", "popWin()" );
and this in the html part.
<script><br />
function popWin(){<br />
window.open('http://msdn.microsoft.com', '', '');");<br />
}<br />
</script>
Best Regards,
Apurva Kaushal
|
|
|
|
|
I have a created a user control which on compilation gives no error. BNut when I try to use this control on my web page gives me an error which sayd "Error creating user control" When I try to get the details of the error it says "Parse Error: Type "'System.Web.UI.UserControl' does not have a property named 'Title'". But I do have a property named Title in my user control. So what is the error. Can anyone help me out.
|
|
|
|
|
UserControl class already has a property named Title.
Make sure you don't override it with a new property in your custom user control that is private or protected, as it is probably called in the designer code.
Hope that helps.
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
Well 'Title' was just an example. It is giving me an error for all of my properties like 'TitleBarLeft' and 'TitleBarRight' etc.
|
|
|
|
|
Hi ,
I have created a logic in stored procedure and in it i look if a variable satisfies certain condition ,if it doesn't i want to raiseerror with appropriate message.Pls tell me how to know if the error has occurred and capture the msg in the frontend.Pls let me know also the right syntax for
writing msgs in RAISERROR .
thnks in advance
|
|
|
|
|
Hi Sishya,
I am explaining RAISERROR syntax by simple example.Modify it as your need.
ALTER procedure sp_AddUsers
@UserID varchar(20)
as
if @UserID=''
Begin
Raiserror('Missing User ID.',16,1)
return(0)
End
Begin Transaction
insert into Users (UserID)
values(@UserID)
Commit Transaction
Regards,
Nagraj
Let's Teach Life To Laugh........
|
|
|
|
|
hi ,
pls tell how to capture this Message in raise error from frontend interface and what about the 16,1 in Raiserror('Missing User ID.',16,1)
|
|
|
|
|
Hi sishya,
16,1 are savirity,status parameters for RAISERROR procedure.Don't think much about then you can get details on net regrading this.
As your core problem To access this RAISEERROR return value....here is code.
private void someMethod()
{
try
{
// Do a RAISERROR inside of a SQL block like
// RAISERROR('You did something wrong with the value "%s"', 16, 1, @param1)
}
catch (SqlException sqle)
{
lblMessage.Text = sqle.Message;
}
catch (Exception err)
{
// Do something else with the exception
}
}
I hope this will help you.
Regards,
Nagraj
Let's Teach Life To Laugh........
|
|
|
|
|
Hi
I have one Web application where I have used window authentication, so every time when user access application popup window will come for userid/password.
Till now there is no problem. Now within same application I have some new page which needs no authentication means Anonymous user can access.
i do not want to use IIS 'Anonymous Access' for whole application.
is it possible we can pass authentication credential by page .
Plz advice me what code I have to write in new page so any one can access these page
Raghvendra Raghuwanshi
|
|
|
|
|
You can simply put your pages in a different web folder and place a web.config file on that particular folder which allows anonymous access (see below). Also if I'm not wrong you can set specific permission to folders from IIS.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</configuration>
Odd...the pre tag didn't preserve the < and >
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
-- modified at 1:51 Wednesday 21st June, 2006
|
|
|
|
|
i planning to put the flash button menu for my site.
but normaly i use frame so the button will have some effect like show submenu. but i found out many asp website dont really use frame because when user trying to scoll down the side frame will always fix there.
but if i use the global thing to fix all my page same as the first page... then my button will always at the beginning part... which i mean in 1 page the user click on the Product button then submenu come out then when user click another time will bring to other page, which the button will not show the submenu of product... user have to reclick again~??
1st page: product->submenu
2rd page:Product (i want to remain wat the user have done in 1st page which is product->submenu...)
|
|
|
|
|
Does this sound familiar to anyone: You're faced with reviewing a spec for a large project and you're trying to come up with a ball park estimate. A common approach (usually combined with others) is to count the number of screens or forms that the project requires. Multiply that by some average number of hours you think it takes to do an ASP.NET form and you've got some starting point for your ball park estimate.
Remember the goal is a superficial review and estimate with the understanding that there may be a large margin of error after a closer analysis of the spec.
So what number do you use for the average number of hours to code an ASP.NET form (1.x or 2.0)? Assume both page and code-behind programming, but not design/CSS, etc.
Just curious...
|
|
|
|
|
because i like to build whole apps in one page(lots of panels).
|
|
|
|
|
What I usually do when estimating is think of a project as similar as posibile with the one I need to estimate. And depending on the complexity add or remove hours to the estimation.
If there's no comparison type, depending of the complexity of the pages: between 1 and 5 hours.
Don't also forget to add some extra hours if your building a n-tier architecture. You need time for BLL, DAL also database design and implementation.
What I usually do is add another 30% extra hours over the estimation. This gives you a good advantage in case you estimated incorectly some tasks.
Well, this is me. If anyone has any recomendations, let me know. There's room for improvement for me too.
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
Hi , Sorry it was really a bad title but i really need to know what is the role of that stuff . i 've read a lot abt that view state but nobody & no document tell you directly what is the role of the viewstate & how it works & when & why we use it
i want an example that make it clear i want you explain it to me can you please ??
thank you
try to be good if you can't be the best
|
|
|
|
|
ViewState is a property of any web control for eg. textbox
the default is true
it means when you refesh the page the value will remain in the textbox
the value of the web control (textbox here) is stored as the encrypted hidden value in the page
and when the page refreshes the textbox takes the value from that encrypted value
ASP.NET uses a hidden input control named _VIEWSTATE to maintain state/values for all non-postback controls that are modified in the code.
ViewState also allows you to store structured data as long as the data is serializable
You can also use the ViewState property of the Page class to store page level values
hope this clears a bit
Rule # 17: Omit Needless Words - Strunk, William, Jr.
-------------------------------------------------------------
Universal DBA | Ajax Rating
|
|
|
|
|
thank you
try to be good if you can't be the best
|
|
|
|
|
Go through this article this will help you a lot.
http://www.aspnetresources.com/articles/ViewState.aspx
Best Regards,
Apurva Kaushal
|
|
|
|
|
I am a beginner programmer and do not understand the concept of database manipulation. So far I have a webform with textboxes and a button. I want to be able to enter information into these textboxes and by pressing the add button, the information should be stored in the database.
Can someone please help me with this?
|
|
|
|
|
you might wanna search @ CP a lot of examples are here at code project
i have an article here [^]
slightly advance but might be useful
Rule # 17: Omit Needless Words - Strunk, William, Jr.
-------------------------------------------------------------
Universal DBA | Ajax Rating
|
|
|
|
|
Hi,
If anybody can help me out in this, i really appreciate the efforts.
I have three bound columns(date(mm/dd/yyyy),starttime,endtime) in datagrid.
i want to sort my datagrid according to date. but the values are in string format as the dataset is populated from an xml file.
i implement this:
boundcolumn.dataformatstring = "{0 }";
but it short my grid according to month only.'
i m using dataview for sorting:
DataView mydataview = dataset.Tables[0].DefaultView;
mydataview.Sort = dataset.Tables[0].Columns["date"].ToString();
datagrid.DataSource = mydataview;
please help me out.
Thanks,
Dhruvil
|
|
|
|
|
Hi,
I don't know exact solution ,but there is alternative you can use orderby clause in your query.
I hope this will help.
Regards,
Nagraj
Let's Teach Life To Laugh........
|
|
|
|
|
Ok, I have a client with a web app in .net and it's the worst most disoranized thing I have ever seen in my life.
Please if your going to do consulting, please learn programming basics first and not on the job (Couse then they hire me to fix your code and they won't let me really fix it (rewrite), I have to use bandaids).
Heres an example of what I'm up agenst:
Theres a button on the form and its visibility is set to false.
btnAdd.Visible = false;
That Button has an onClick event, and that event says:
btnAdd.Visible = true;
My client said, why can't we ever see the button... lol
Matthew Hazlett
Sometimes I miss the simpler DOS days of Borland Turbo Pascal (but not very often).
|
|
|
|
|
might wanna post it in www.dailywtf.com
this is programming question forum
Rule # 17: Omit Needless Words - Strunk, William, Jr.
-------------------------------------------------------------
Universal DBA | Ajax Rating
|
|
|
|