|
Christian Graus wrote: top level
Christian Graus wrote: session start events
that means global.asax ???
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
i have used the dropdownlist with data from database Whenever i run my application it always shows the first item of the dropdownlist as my selected item.How can avoid this Plz hel me?
|
|
|
|
|
Bind DropDownlist inside !Page.IsPostBack
<br />
if(!PageIsPostBack)<br />
{<br />
}
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
|
|
|
|
|
your question makes absolutely no sense. 'every time you run the application' ? If you mean every time you do a postback, then the other answer you got is correct. If you mean what you said, what did you expect it to show ? If you want to show something else, then you need to set the selected index. Perhaps if you explain yourself better.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi
Respected Sir
I Want To Know How To Write Crystal Reports In VisualStudio2008 Using ASP.Net+Csharp Please Send Me The Procedure how to
Start The CrystalReports And How To Write The Procedure I Don't Know How To Open From Vs2008 Please Answer My Query
From
Lakshman
|
|
|
|
|
Hello dear,
I want to use RecordSelectionFormula in to Sql Server Reporting Sevices 2005 in code behind file somthing like we use in Crystal Report.
Please Help me..
Thanks,
Nilesh..
|
|
|
|
|
hi,
i hav aproblem with crystal report in asp.net.when i display report with crystalreport viewer that its allignment change to central.but at design i allign it to left.how to slove this problem plz help me.
|
|
|
|
|
Hi guys,
I have a textbox in that i have mentioned autopostback [property true and its event(ontextchanged") i am executing my code bolck is there name already exist or not in database...,
but this ontextchanged event getting fire on my button click event only...,
its not excuting the textchanged place...,
is there anything i want to add in that place to fire the event?....,
this my sample code bolck:
<asp:textbox id="txt_section" cssclass="textboxGQ" runat="server"
="" ontextchanged="txt_section_TextChanged" autopostback="True"><asp:label
id="lbl_avail" runat="server" text="">
protected void txt_section_TextChanged(object sender, EventArgs e)
{
AdminDAL objadmin = new AdminDAL();
DataSet DS = new DataSet();
DS=objadmin.DAL_Availabilty(txt_section.Text);
if(DS.Tables[0].Rows.Count>0)
{
count=Convert.ToInt32(DS.Tables[0].Rows[0]["sectname"].ToString());
}
if (count > 0)
{
lbl_avail.Text = "Section Name Already Exists";
}
else
{
lbl_avail.Text = "Section Name Available";
}
}
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
I am astounded by the constant stream of people stupid enough to think that an entire web page reloading whenever they press a key, is a good idea.
You can handle a javascript event which will fire whenever a key is pressed. You can then write AJAX code to do this check if you want to. I think it's a dumb idea. What if what they have typed half way through exists, but they want to type some more ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I agree with you, however I am sure you have seen at least a website full of UpdatePanels that are doing partial post backs and then the developers that don't understand the Page life circle write sh*t code that makes the whole application unmaintainable.
So if they cannot write their own JavaScript methods and being able to handle the callback of the webservices, maybe is better to do a whole postback... (very sad... but true).
having said that... that's what (and how) I would do (following Christian approach)
I would recommend you write your own javascript handler and call a webservice using the microsoft AJAX wrapper.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="YUITable._Default" %>
<%@ Register TagPrefix="csl" Assembly="YUITable, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace="YUITable" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<html>
<head runat="server">
<script type="text/javascript">
var tbMaster_SelectedDataChanged = function ( dataTable, selectedData )
{
YUITable.LoremIpsum.GetDataWithParameters (0,1,2,onSuccess, onFailed );
function onSuccess ( result )
{
var childTable = document.getElementById ( "tbChild" ).childNodes [ 1 ];
if ( dataTable )
{
var data = Array.parse ( result );
CreateDateTable ( "tbChild", tbChildheaders, data );
}
}
function onFailed ( )
{
alert ( "error" );
}
};
</script>
</head>
<body class="yui-skin-sam">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server" >
<Services>
<asp:ServiceReference InlineScript='true' Path="LoremIpsum.asmx" />
</Services>
</asp:ScriptManager>
</form>
</body>
</html>
Ricardo Casquete
|
|
|
|
|
I would recommend you write your own javascript handler and call a webservice using the microsoft AJAX wrapper.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="YUITable._Default" %>
<%@ Register TagPrefix="csl" Assembly="YUITable, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace="YUITable" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<pre>
<html>
<head runat="server">
<script type="text/javascript">
var tbMaster_SelectedDataChanged = function ( dataTable, selectedData )
{
//Perform the Call to the WebService passing the values of the first Selected Row values as arguments
YUITable.LoremIpsum.GetDataWithParameters (0,1,2,onSuccess, onFailed );
//Handling the Result of the WebService call
function onSuccess ( result )
{
var childTable = document.getElementById ( "tbChild" ).childNodes [ 1 ]; //The Real data is the Second Child
if ( dataTable )
{
var data = Array.parse ( result );
CreateDateTable ( "tbChild", tbChildheaders, data );
}
}
function onFailed ( )
{
alert ( "error" );
}
};
</script>
</head>
<body class="yui-skin-sam">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server" >
<Services>
<asp:ServiceReference InlineScript='true' Path="LoremIpsum.asmx" />
</Services>
</asp:ScriptManager>
</form>
</body>
</html>
</pre>
Ricardo Casquete
|
|
|
|
|
Hi all,
On asp.net page load i am calling a javascript function on window.onload function.
In this function i am assigning some values to hidden field and when i am trying to read
this value from page behind it return "".I am trying to access the hidden fiedl value
on page load.
string value= hiddentxt.value;
but value returns "". Will anybody help me to solve the problem?
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Are you checking the value on postback, or on the first load of the page ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
on the first page load.
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
You post here a lot to not know anything about how ASP.NET works. You should buy a good book and read it.
When your page is rendered, it's because it's been delivered the HTML to render it., Which means that ASP.NET has already run the full page lifecycle, and generated the HTML. I don't see how else it could work, or why you'd think it would work differently. What you want to do is impossible. You want the onload event to fill a property, before your code has generated the page.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
When the asp.net page load then first it execute the code in .cs file and then it
execute the javascript function. so i got "" in my hidden field value.
n i know about asp.net page life cycle..
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
Yes, that's right. So, there's no way you can read it in your page load, for the first cycle, because, as you said, it gets read into the hidden field AFTER the page has run on the client side.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Is it a popup?what u r trying to achieve?whats ur requirement?i mean r u trying to pass values from another page?tell me your requirement so that we can try to find out a solution...
|
|
|
|
|
Ok thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
I am using System.Windows.Forms
OpenFileDialog ofd=new OpenFileDialog();
Thread sd=new Thread(new ThreadStart(()=>ofd.showDialog()));
sd.SetApartmentState(ApartmentState.STA);
sd.Start();
sd.Join();
It displays OpenFileDialog but it goes behind browser window how to bring front
|
|
|
|
|
sivasampathkumar wrote: I am using System.Windows.Forms
Then why are you asking in the ASP.NET forum ?
sivasampathkumar wrote: It displays OpenFileDialog but it goes behind browser window how to bring front
What does a browser have to do with your question ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Seriously, I looked, and every one of your posts has at least two of the following things in common
1 - the subject says 'please help me' instead of something useful ( every post does this )
2 - you post in the wrong forums ( I found an ASP.NET question in the managed C++ forum )
3 - you have no idea what you're doing
I find it very frustrating to try to help people who not only are as dumb as toast, but who don't answer when I try to help them. The answer is, you have no idea what you're doing. You're plainly trying to use an openfiledialog in a web page ( I worked that out for sure from an earlier question ). This makes you utterly clueless, and I only hope you're teaching yourself. If you have a teacher, he is a failure. If you are doing paid work, you are a liar and a thief, because you don't come close to knowing enough about what you're doing to write anything to even a semi professional standard.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I've got IIS 5.1 installed and at the root there is index.html that can be accessed from the internet.
When I put to the root VS2008 web project application (e.g. just simple with single button click, that works for sure) the server returns:
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request
The default.aspx is specified in the list of default files.
Чесноков
|
|
|
|
|
Chesnokov Yuriy wrote: Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request
There can may causes for this error. May be virtual directory is not configured properly.
Start > Run > Eventvwr
Check what exact error is logging over there when you trying to access the site. This will give you the clear idea about your problem.
Thanks
|
|
|
|
|
i want to update a gridview which contain textboxes and a dropdownlist. i use this code to update a dropdownlist in gridview by running this code it show an error does not contain definition for row index
protected void GridView1_RowUpdating(object sender, GridViewUpdatedEventArgs e)
{
string struName =(DropDownList)(GridView1.Rows[e.RowIndex].Cells[4].FindControl("Drop")).SelectedValue;
e.NewValues["Active"] = struName;
}
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="TransactionTypeID" DataSourceID="SqlDataSource3"
style="top: 345px; left: 390px; position: absolute; height: 133px; width: 187px; z-index: 1"
onrowupdated="GridView1_RowUpdating">
<Columns>
<asp:BoundField DataField="TransactionTypeID" HeaderText="TransactionTypeID"
ReadOnly="True" SortExpression="TransactionTypeID" />
<asp:BoundField DataField="Transaction" HeaderText="Transaction"
SortExpression="Transaction" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
<asp:BoundField DataField="Category" HeaderText="Category"
SortExpression="Category" />
<asp:TemplateField HeaderText="User Name">
<ItemTemplate>
<asp:Label ID="lbl1" runat="server" Text='<%# Bind("Active")%>' />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="Drop" runat="server" AppendDataBoundItems="true"
AutoPostBack="True" SelectedValue='<%# Bind("Active")%>'>
<asp:ListItem Value="Yes"></asp:ListItem>
<asp:ListItem Value ="No"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
modified on Tuesday, August 4, 2009 1:59 AM
|
|
|
|