|
Using the GridView-object makes working with data in a grid more easily.
There are tons of examples for you to make it like that.
ASPX:
<asp:gridview id="myGridView" runat="server" datakeynames="ID">
<colums> <asp:HyperLinkField DataTextField="TypeNum" HeaderText="TypeNum" />
<asp:boundfield datafield="int_bguser" headertest="BG user">
in Your ASPX.VB you create a Method which is called IN the page_load eventhandler.
In that created method you retreive your data from the database and DataBind it to the myGridView component.
Good Luck!
|
|
|
|
|
hello. i m creating a weblist. i wanna save to database website meta keywords which are added my website. for example a user entered to my website and added him/her web site addres to my database. (www.sitename.com) when i allowed this web site publish in my website, i wanna automatically add meta keywords (title, description...) of this web site to my database. how i can this? how i can access to websites meta tag?
regards.
viva la commune
|
|
|
|
|
Hi, i'm in the process of learning ASP, so this is probably a really stupid question.
I'm trying to create a simular effect to the green menu bar the code project has above. On the left i would like the menu, and on the right, the login status.
I have tried a few things with div tags and styles but not got it working correctly. I notice above it is done with tables. Is that the only / best way to do it.
This is the snipet of code im working at the moment. The left and right styles just have float set to left and right (surprisingly).
<div id="mainMenu" >
<asp:SiteMapDataSource ID="siteMapDataSource" runat="server" ShowStartingNode="False" />
<asp:Menu ID="menu" runat="server" DataSourceID="siteMapDataSource" Orientation="Horizontal"
DisappearAfter="200" StaticEnableDefaultPopOutImage="False"
CssClass ="left">
</asp:Menu>
<div class="right">
<asp:LoginView ID="loginView" runat="server">
<LoggedInTemplate>
<asp:LoginName ID="loginName" runat="server" />
</LoggedInTemplate>
<AnonymousTemplate>
You are not logged in
</AnonymousTemplate>
</asp:LoginView>
|
<asp:LoginStatus ID="loginStatus" runat="server" />
</div>
</div>
<div id="content">
<asp:ContentPlaceHolder ID="mainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
Thanks in advance for any help.
|
|
|
|
|
Hello friends,
I want to transfer some data from one form to another form.
But i don't want to use session or querystring.
Is there any other way to transfer tha data.
Deepak Nigam
|
|
|
|
|
Help yourself to these[^] links.
|
|
|
|
|
you can use Hidden field.
mitesh
|
|
|
|
|
Why is it that I keep answering this same question lately ?
Create your two pages as controls, and show them both on the one page. Then viewstate will hold the data for you, your main page just has to move the data between the pages as it shows/hides them.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How do I find my servername and port number on my own computer?
I want to do this on my local before i use a hosting.
|
|
|
|
|
They don't relate to your computer, they relate to your ISP. Check Out look, they will be in there, or you wouldn't be able to check your mail.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I have a DLL with some win controls in it that i am embedding in a ASP.NET page. However, when ever i want to select from the database i get OleDbPermission exceptions even after i've done: Demand(); or Assert();
Is there a simple way of just telling IE to just trust the DLL and ignore all the security issues since this is a personal project and will only ever be run on my computer.
Regards,
Gareth.
|
|
|
|
|
I am having a grid and it contains two columns. The First Column contains one Image and the second column contains table and in the first row of the table i have a Link button like this :
<asp:linkbutton text="">]]>' runat="server" ID="BookTitle">
And i want to invoke an event during onclick event of this link button.
Also if i use onSelected_IndexChanged event in grid view like :
public void GridView1_OnSelectedIndexChanged(object sender,EventArgs e)
{
e.-----------
}
This event is not occuring.
I am working on 2.0 gridview.What should i do to invoke the event .Where i am wrong.
Can anybody helpme
VanithaVasu
|
|
|
|
|
The LinkButton should have a CommandArgument as "Select". This would trigger the SelectedIndexChanged event. Have you noticed it?
|
|
|
|
|
I'm using the following to insert a record in my DB;
protected void submitButton_Click(object sender, EventArgs e)
{
DataSet2TableAdapters.guestsTableAdapter adapter = new DataSet2TableAdapters.guestsTableAdapter();
adapter.Insert(nameTextBox.Text, messageTextBox.Text);
adapter.Dispose();
}
And it succeeds in the insert but the page doesn't show the new data but, if I go to another
page and come back it shows up.
So my question is how do I update the page where I'm doing the INSERT after I do the insert.
Much obliged,
Mike
|
|
|
|
|
The order is page load, then events, then page prerender. I'd say you're loading your data in page load, before the event fires to add the new record.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian,
Thanks that makes sense. Would it make any sense to reload (?fill?) in the prerender stage?
Thanks
Mike
|
|
|
|
|
I think Rebinding the datasource after the insert will solve the issue.
|
|
|
|
|
Thanks for the advice I got it to work by overriding the Page's OnPreRender method!
Works like a charm!
Mike
|
|
|
|
|
I have an ASP.net web page,
From the web page how can i write
the content of a text box to serial port.
Please help me.
|
|
|
|
|
Member 4663137 wrote: From the web page how can i write
the content of a text box to serial port.
It's not possible. ASP.NET is not built for that.
|
|
|
|
|
I have an application that I would like to show different login pages based on the client or url. I have the roles and members setup and I have a default value for the loginurl parameter in the web.config. I would like to intercept this before the page redirects to login.aspx and be able to define the loginurl or use the FormsAuthentication.RedirectToLoginPage() method. Where is the best way to do this?
Also I am using a basepage for all of my pages.
|
|
|
|
|
HELP... one of my DBA wrote me this oracle sp, when my web form call this sp, I will pass over 2 params which which are firstname and lastname, then this sp will insert the 2 params to the table, if the insert succ, the sp will return 0 else return and 99 for error, how can i retrieve the error_code from my code behind. i dont need to retrieve the error_mes
PROCEDURE Insert_Data(
i_lastname IN VARCHAR2,
i_firstname IN VARCHAR2,
error_code OUT NUMBER,
error_mes OUT VARCHAR2
)
IS
BEGIN
INSERT
INTO new_table(
rec_id,
i_firstname,
i_lastname,
created_date,
new_old,
created_by
)
VALUES (
rec_id.nextval,
firstname,
lastname,
SYSDATE,
'New'
);
error_code := SQLCODE;
error_mes := SUBSTR (SQLERRM, 1, 250);
COMMIT;
EXCEPTION
WHEN OTHERS THEN
error_code := SQLCODE;
error_mes := SUBSTR (SQLERRM, 1, 250);
END;
from code behind , how can i retrive the error code
---------------------------------
public int Insert_Data(string first_name, string last_name)
{
string OracleConnString = ConfigurationManager.ConnectionStrings["connstr"].ToString();
using (OracleConnection conn = new OracleConnection(OracleConnString))
{
OracleCommand cmd = new OracleCommand("Class.Insert_Data", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("i_firstname", OracleDbType.Varchar2, first_name, ParameterDirection.Input);
cmd.Parameters.Add("i_lastname", OracleDbType.Varchar2, last_name, ParameterDirection.Input);
cmd.Parameters.Add("error_code", OracleDbType.Int32).Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();
//What should i do here
return return_code;
}
}
|
|
|
|
|
Kennie_n2000 wrote: error_code OUT NUMBER,
As you can see the errorcode is an OUT parameter, value would be in the 3rd parameter. You can get it like
cmd.Parameters[2].Value
|
|
|
|
|
I tried what u 've suggest but i am getting the exception error" exception {"ORA-06550: line 1, column 15:\nPLS-00306: wrong number or types of arguments in call to....
when it execute line cmd.ExecuteNonQuery();
I should only need to pass in 2 arguments which are firstname and lastname only right ? any ideas ?
public int Insert_Data(string first_name, string last_name)
{
string OracleConnString = ConfigurationManager.ConnectionStrings["connstr"].ToString();
using (OracleConnection conn = new OracleConnection(OracleConnString))
{
OracleCommand cmd = new OracleCommand("Class.Insert_Data", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("i_firstname", OracleDbType.Varchar2, first_name, ParameterDirection.Input);
cmd.Parameters.Add("i_lastname", OracleDbType.Varchar2, last_name, ParameterDirection.Input);
cmd.Parameters.Add("error_code", OracleDbType.Int32).Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();
return Convert.ToInt32(cmd.Parameters[2].Value);
}
}
|
|
|
|
|
I'm using a DataList to present a list of TextBox - RadioButton pairs. Now I don't want to go through the whole thing of putting a row into edit mode etc. I want to do a client side Ajax postback when the RadioButton is clicked, or on blur of the textbox. How do I get the parent row of these controls? I need this to store an ID attribute so I can specify which record to update during the Ajax call.
I've thought of using an invisible column with the ID, but I need to know how to access the parent of the control causing the event, then access its cells collection, then get back to the ID value.
|
|
|
|
|
When i developed application in asp.net i have used differnt validators.The question is if i use Example:textbox shd not be blank
I have used one requiredfieldvalidator
and in code behind like in
if
isdbnull(txt.text) or txt.text=""
msgbox("blank")
elseif....
end if
if i use both validators as well as validators it that cause application performance??
thistype of code occurs many times in the application.So please can any body give some answer.
And also "autopostback=true" property of some controls makes the server hits more.So at the user end appln becomes slow.What to do for this??But i have to set that property as per appln concern.
Please respond somebody for this question.
kissy
|
|
|
|