|
Dear Sir,
Why all page (.aspx) after compile contain only the string below
"This is a marker file generated by the precompilation tool, and should not be deleted!"
Why it don't like asp.net 1.1?
How to make those file allow I edit html tag and upload the only changed aspx file.
And how to set IIS.
Thank You.
|
|
|
|
|
When you publish the web site you choose whether the web site should be updateable or not. If you don't make it updateable, the pages will be marker files and the actual pages will be created by code.
---
b { font-weight: normal; }
|
|
|
|
|
hi all..
i have the dropdownlist in formview in EditItemTemplate and have the sqldatasource of both(dropdownlsit and FormView) is different.i want to update and insert the detail of person along with dropdownlist selecteditem through inline coding. i did specified the commands (insert, update, select, delete ) in configuration mode. and there is another dropdownlist in formview whose collection are fixed.
pls if you have any democode using inline coding pls send as soon.
Regards,
srinandan mall
|
|
|
|
|
Below is a quick example to demonstrate what you might want to do with the Northwind database.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FormView ID="FormView1" runat="server" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"
DefaultMode="Edit">
<EditItemTemplate>
ProductID:
<asp:Label ID="ProductIDLabel1" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label><br />
Category:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="CategoryName" DataValueField="CategoryID" SelectedValue='<%# Bind("CategoryID") %>'>
</asp:DropDownList><br />
ProductName:
<asp:TextBox ID="ProductNameTextBox" runat="server" Text='<%# Bind("ProductName") %>'></asp:TextBox><br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductID], [CategoryID], [ProductName] FROM [Products]"
UpdateCommand="UPDATE [Products] SET [CategoryID] = @CategoryID, [ProductName] = @ProductName WHERE [ProductID] = @ProductID">
<UpdateParameters>
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="ProductName" Type="String" />
<asp:Parameter Name="ProductID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
|
|
|
|
|
hi;
i hv problem i hv datagrid in datagrid there is a dropdownlist this list is
dynamically populated thorogh database..i wnt to validat the item in the datagrid throgh javascript function..i pick the dynamic generated IDs of dropdwonlist..how can i call the javascript function from my code
or see below either i m correctly calling the javascript function
Public Function test(ByVal send As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim dl As DropDownList = e.Item.FindControl("DropDownList1")
Dim str As String = "valfunc(" + dl.ClientID.ToString + ")"
dl.Attributes.Add("onChange", str)
End If
End Function }
And here is the code which will be there in html section:
"asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 144px"
runat="server" Width="464px" Height="80px" "OnItemDataBound="test"
" Columns>
" asp:TemplateColumn>
" ItemTemplate>
" asp:DropDownList ID="ddl" Runat="server">
" asp:ListItem>oooo
" asp:ListItem>aaa
" asp:ListItem>bbb
" /asp:DropDownList>
" /ItemTemplate>
" /asp:TemplateColumn>
" /Columns>
" /asp:DataGrid>
And this is the javascript function for validation:
"script language=javascript>
function ValFunc(ss)
{
alert(ss.value);
return false;
}
" /script>
the error is the OnItemDataBound="test" the function test is in my vb.net code..this function is nt call..or tell me either i m correct to whn i m calling Javascritp function form my vb.net code here is the code snippoet Dim str As String = "valfunc(" + dl.ClientID.ToString + ")"
the valfunc is the javascript funciton
waiting for reply
-- modified at 2:51 Saturday 24th June, 2006
|
|
|
|
|
nabeelkhan wrote: "asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 248px; POSITION: absolute; TOP: 144px"
runat="server" Width="464px" Height="80px" "removed="test"
What is removed="test" here.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi
Guyes
I m starting asp.net 2005 application. pl help me. i want to add/edit/delete
a user in the sql server databaase. Which option should i adopt
1. Thru ADO.Net
2. Thur Sql Server Stored Procedures
Which is the best and why.
Thanks
Sachin Thamke
|
|
|
|
|
Hi friends,
I have a dropdownlist and a button. i want some operation at onselected index of dropdownlist but after selecting the item in the dropdownlist there happens nothing but when i click the button same operation starts processing .can u help me.?
bye
|
|
|
|
|
hi amaneet,
This is because when you are clicking on the button, "PostBack" happens .While clicking on a dropdown list doesn't cause PostBack.
Make the AutoPostBack property of the dropdownlist to TRUE to fire your code.
Tirthadip
|
|
|
|
|
Hi,
I hope you have written your code in dropdownlist_selectedindexchanged() event.Only problem is,you could not execute that code.
Just right click on dropdownlist in properties window set AUTOPOSTBACK property to TRUE.
I hope this will work.
Regards,
Nagraj
Let's Teach Life To Laugh............
|
|
|
|
|
Hi ,
well i'm a beginner into ASP.Net world & i've needed to use that event but i think it doesn't working well with me
what i want to do is just when i write something in the TextBox1 the same text will been written in the Label1 BUT i can do that but just when i leave that textbox then the text or the value in the text box is written in the label but i wanna do that immediatley i mean when i write the first lettre in ma textbox this letter will written in the label too
i hope you understood ma question & i hope you can help
well i heard abt something called AJAX & javascript & some stuufs can you tell me what is that heck man ?
thank you very much for your help
try to be good if you can't be the best
|
|
|
|
|
Hi,
When you double click on textbox it will take you to Textchange procedure you can write what you want there.
May be this is different solution which you expect, if yes Please explain you problem in more detail.
Regards,
Nagraj
|
|
|
|
|
In My project(ASP.NET),Inside a usercontrol I am generaing table dynamically according to the data from the DataBase.
Table Id is also generated dynamically. I required the table Id again in the CS, after creating all tables, for adding datas to a particular dynamically created table.
Please help me to do so.
-- modified at 2:14 Monday 26th June, 2006
|
|
|
|
|
If I want to have a variable available to multiple pages, what is the best way to go about it?
For example: page 1 user enters something in textfield. I want to save that value in multiple pages. Do I use the global.asax?
|
|
|
|
|
Application or Session variables, cookies, or even query strings could accomplish this.
|
|
|
|
|
I've not worked with session variables or cookies before. I will research on my own but do you have any good reference sites/articles off hand?
|
|
|
|
|
My apologies to those of you who have read my multiple questions on my evil datagrid. Okay, it's not evil, but sometimes I think it is.
I have a webpage in which the user enters a part number in a textbox. User then clicks command button to load the datagrid. I created one project and got this to work beautifully thanks to the help of CodeProject people.
Then I found a fully editable datagrid and source code. Since it basically had the functionality I needed I started to modify that. This works differently in that you use a stored procedure, and use parameters to the server.
The original project just dumped out employee information from the Northwind database. Changed stuff so it just dumped out my part IDs. Worked fine. My problem comes from when I pass a parameter (the part number entered by the user). I'm new and confused. This is what happens:
Situation 1:
Call BindData in postback
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
<br />
if(Page.IsPostBack)<br />
{<br />
BindData(); <br />
<br />
}<br />
<br />
}<br />
<br />
private void BindData()<br />
{<br />
strPartNumberInputReference = txtSearchPart.Text;<br />
ds = new DataSet();<br />
SqlParameter param = new SqlParameter("@PartID", strPartNumberInputReference);<br />
ds=SqlHelper.ExecuteDataset(this.connectionString, CommandType.StoredProcedure, "dbo.GetPartInfoTest2", param);<br />
Session["ds"]=ds;<br />
dt = ds.Tables[0];<br />
Session["dt"]=dt;<br />
dgParts.DataSource=dt;<br />
dgParts.DataBind();<br />
txtSearchPart.Text = "";<br />
<br />
}
Go through debugger and goes through code just fine. (The adapters and stuff are in a SQLHelper.cs class.) But it doesn't return any rows.
Situation 2:
Call BindData on postback and when user clicks button:
same code as above plus
private void btnSearchPart_Click(object sender, System.EventArgs e)<br />
{<br />
BindData();<br />
}
When I go through the debugger it goes through the stuff twice as expected. It returns rows, but it returns three blank rows.
I'm not sure at this point where the problem lies. I don't know if is a parameter issue, a BindData issue, a postback issue.
As always...huge thanks.
|
|
|
|
|
I don't want to drag and drop datagrid from tools, but I just want to create it during runtime using vb.net syntax on asp.net page using asp.net 1.1 version. ASP.NET 2003.
dim dg as datagrid
then adding bound column by creating its object. It is fine upto this level. Even it gets implemented. But I couldn't find any article that helps in generating events for RUNTIME GENERATED DATAGRID. So can anybody help in this regard. I would like to implement events like PageIndexChanged, SortCommand, ItemDataBound. So please help in this regard.
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
I'm using VS.NET 2005, but it should be similar:
DataGrid myDataGrid = new DataGrid();
myDataGrid.PageIndexChanged += new DataGridPageChangedEventHandler(myDataGrid_PageIndexChanged);
...
protected void myDataGrid_PageIndexChanged(object sender, EventArgs e)
{
....
}
|
|
|
|
|
Thanks for ur help
But ur code doesn't work after converting in vb.net means like this
dim dg as new datagrid()
dg.pageindexchanged event is not available.
Does I need to import some file?
Wht should I do now?
I think I need to add RaiseEvent as event bcoz when I write
dg.pageindexchanged
It gives me error saying 'dg.pageindexchanged is a event and cannot be called directly. Use RaiseEvent statement'
Can u suggent me on this event?
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
-- modified at 12:37 Friday 23rd June, 2006
|
|
|
|
|
Sorry, I didn't notice you are using vb.
I don't know exact syntax for handling events in vb, but this is what I found on msdn:[^]
'----------------------------------------------
Visual Basic (Usage)
Dim instance As DataGrid
Dim handler As DataGridPageChangedEventHandler
AddHandler instance.PageIndexChanged, handler
'----------------------------------------------
This code is not supposed to raise event, but assign event handler to event. Event is raised automaticly when you change page of datagrid by clicking it.
I hope it helps
-- modified at 8:44 Sunday 25th June, 2006
|
|
|
|
|
hello guffa,
i have seen u giving suggestions lots of times. It is better if u give code rather than suggestions.
ok.Plz Dont domlike that.
kaya kosta,
byeeeeeeee
|
|
|
|
|
ballameharmurali wrote: i have seen u giving suggestions lots of times. It is better if u give code rather than suggestions.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Give a man some code and you solve his problem today. Teach a man to code and you solve his problems for a lifetime.
By giving suggestions and links to documentation Guffa is teaching you how to think. If he just straight gave the code then people would just copy and paste the code and never really understand how it works. So what happens is that they come back and ask for more and more code. I've seen it several times when I answer the same person over and over with pretty much the same question with a minor modification. If they'd read the docs rather than just copy the code they wouldn't need to keep asking pretty much the same question over and over and over and over and over and over and over and over and ove and over and over and over... Well... you get the idea.... I hope.
Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?
My: Website | Blog
|
|
|
|
|
everyone should first facing with problem and if can't find soultion codeproject's members can help each-other.
"If you haven't succsess in life that mean you didn't try anything in your life"
|
|
|
|
|
if (question.Topic == QuestionTopics.Code) {
Reply.Write(knowledge.DoCorrections(question.Code));
} else {
Reply.Write(knowledge.FindSuggestion(question.Problem));
}
---
b { font-weight: normal; }
|
|
|
|