|
Dear friends,
I am working on ASP.NET 3.5 with C# Web Application. I want to upload some data to Sql Server Database. I am fetching some existing data from sql server database and want to display user like already these many records available in database. Do u still want to upload? If user clicks on yes it should display some other controls to upload data. If No, some other action to be taken. Please tell me how to prompt the user to do the above task. Please help me.
Thanks,
Dileep.
|
|
|
|
|
|
After implementing a CSS template to my web site i am getting the following error while running. "Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. "
I searched a lot in net and found some solutions which did not worked for me. But my actual problem is the same code is working in another browser. I am getting the error while i am using IE. What is the reason and solution???
|
|
|
|
|
Hi,
I am implementing error handling in my website developed in ASP.Net MVC & C#. To do this, I have set CustomErrors attribute in my web.config file as below
customErrors mode="On" defaultRedirect="Error.aspx"
This should ideally redirect user to default error page which is present in Views/Shared/Error.aspx.
This bebavior was working perfetly untill I changed the base class of my controller classes. Earlier, the base class was "Controller" but for some internal logic, I changed it to ControllerBase and my ControllerBase is now inherited from Controller class.
For example
HomeController : ControllerBase
{
...
...
}
ControllerBase : Controller
{
...
...
}
But now when I run the application and some unhandled error occurs, the user is not redirected to Error.aspx any more. Instead it gives error page as below. Even if I set custom errors mode to "On".
----------------------------------------------------------------------
<configuration>
<system.web>
<customerrors mode="RemoteOnly">
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customerrors mode="On" defaultredirect="mycustompage.htm">
----------------------------------------------------------------------
Any help will be appreciated...
Thanks
Anil
|
|
|
|
|
Hi,
In my Web application, I have the following block of code :
app.Context.Response.StatusCode = 301;
app.Context.Response.Status = "301 Moved Permanently";
app.Context.Response.Redirect(urlRouteResult.RoutedUrl);
Recently, I read an article and found that, Response.Redirect issue the Http Status code 301, so is it redundant to use the code app.Context.Response.StatusCode = 301; when I am using app.Context.Response.Redirect(urlRouteResult.RoutedUrl); ?
|
|
|
|
|
Response.Redirect actually sends code 302 not 301. See MSDN [^]
|
|
|
|
|
Thanks,
So, if I want to send 301 code, is the following code my only option ?
app.Context.Response.StatusCode = 301;
app.Context.Response.Status = "301 Moved Permanently";
app.Context.Response.AddHeader("Location", urlRouteResult.RoutedUrl);
|
|
|
|
|
If you are using 4.0 there is already a method for this, RedirectPermanent[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i m working on custom ajaxEditor Control
i have override FillTopToolbar() method of editor class and added some buttons.
now i want to add InsertImageButton to toolbar fro that i have written
TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.ImageButton());
but i m getting following error-
Cannot create an instance of the abstract class or interface 'AjaxControlToolkit.HTMLEditor.ToolbarButton.ImageButton'
so plz tell me how can i add this button to toolbar..
thanking u
|
|
|
|
|
this the same problem to me any solve????
|
|
|
|
|
Hi,
I want to add tablerows and columns on every button click in asp.net(C#.net) for existing table, after that i want to save all these rows data in the database. please help me out How to create table rows and columns dynamically and save in the database. Client will not allow the javascript in the pages.
Thanks in advance, and help me out.
-Murty
|
|
|
|
|
let say you have table name 'tblData'.
Now if you want to add table row then create table row by
TableRow tr = new TableRow();
Create table cell and add it to table row
TableCell tbcell = new TableCell();
tr.Controls.Add(tbcell);
Then add it to your table
tblData.Controls.Add(tr);
|
|
|
|
|
Thanks also from me!
I was wondering about that the other day, but then got distracted.
You have reminded me and solved it in one go
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Thanks Dalek Dave
|
|
|
|
|
below code is default.aspx
but default.aspx was called so many time.
jungJava() function is called always and don't stop.
i don't know why....
////////////////////////////////////////////////////////////////////////////////
<script type="text/javascript">
function jungJava()
{
debugger;
alert("called");
document.getElementById("txtTest").value = "11000";
count++;
form1.submit();
}//function jungJava()
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="hidden" id="txtTest" name="txtTest" value = "1" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
<script type="text/javascript"> jungJava(); </script>
</html>
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
Of course it is, you're telling it to.
<script type="text/javascript"> jungJava(); </script>
This is going to run every time the page loads. Then your script submits the form which causes it to reload, which causes the script run, which submits the form, which cause to reload, which causes...see how it goes?
If you want to happen once then trigger it with an event, such a button click.
Also, notice how the code snippet here is formatted? Use it next time
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi folks
I'm building this registration system in my asp application and I've got a question. I'd be happy if you provide me with an answer.
I have a code block to check if the entered email exists or not. I've used executeScalar method here. so when the email exists I receive a ONE. now I made an if block telling the machine to print an error then and stop the process. because I'm putting the main process (saving user to DB) after this checkpoint, HOW can I stop the code blocking from process(going on to insertation) if email exists before?
I mean I want the transaction to stop if email exists and this requires I think something like break; or ... . can you help me?
Proper Prepration Prevents Poor Performance! h
|
|
|
|
|
I think this validation is better to do on DB.
But, instead
break use
return
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
modified on Sunday, May 23, 2010 6:05 PM
|
|
|
|
|
Hello I'm Developing an Online Examination System using ASP.NET
- I just want to know the best way to store the students answer in the database
is it better to store the Id of the Selected option or the value of it
and What I have to store when the answer of question is text ?
- how to display the quesitons depending on their type for example :
Multichoice with one answer [Radio list box]
Multichoice with many answer [check list box]
regards ,
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
1. Better is to use ID of the selected option which is selected answer of one question.
2. If question is multi-choice then use CheckListBox otherwise use RadioListBox.
Take and look Visual CertExam, you will get idea how will looks and works your application.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
thanks a lot I appreciate your answer
well I have another question
I want to build this application using either ASP.NET or ASP.NET MVC 1.0
how can I take the decision in using one of them especially that I need to learn MVC before I start
what are the points that I have to take in consideration when taking this decision ?
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
Hi..
I know the simple concept but i dont know ...
I have two drop down list in client side..
First Drop down should load automatically when page load...
Now i want select some values in first drop down list and its based up on value automatically load in second drop down list...
i know the server side coding.. but i want client side because i have reduced post back event..
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title>
<script type="text/javascript">
showDropDown=function(){
dds=document.getElementsByTagName("SELECT");
for(i=1;i<4;i++){
dds[i].style.display="none";
}
dds[dds[0].selectedIndex + 1].style.display="inline"
}
</script></head>
<body>
<select onchange="showDropDown()">
<option>Milk</option>
<option>Coffee</option>
<option>Tea</option>
</select>
<select style="display:none">
<option>chocolate</option>
<option>strawberry</option>
<option>skim</option>
</select>
<select style="display:none">
<option>black</option>
<option>columbian</option>
<option>arabic</option>
</select>
<select style="display:none">
<option>iced</option>
<option>hot</option>
<option>green</option>
</select>
</body>
</html>
modified on Sunday, May 23, 2010 12:36 PM
-- Modified Monday, August 2, 2010 2:04 PM
|
|
|
|
|
thanks for reply.....
i want to connect database in both drop down....
can u send me the sample for that
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
Hi,
I have search facility on my web site. I am using .NET framework 3.5 with ASP.NET C# and I would like to display an image on the page. The image i am retrieving is directly from a web site e.g http://somewebsite.com/images/image1.jpg
I am trying to use the <asp:image> control and tried to set the Image URL to the web address but it doesnt work.
I know how to display the image from a web server when using Windows Form by using system.Net and using http requests but i dont know how to go about implementing this in web site.
I would appreciate if somebody could assist me with this?
Thanks,
|
|
|
|