|
Ersan Ercek wrote: However the code below gives nullreference problem. Can not Viewstate be used at pre_init event?
Yes. This is Correct.
Because ViewState Data Load Just Before the Page_Load Event. So, if you are accessing ViewState in Pre_Init() it will not be initialize. Because LoadViewState() comes a later stage in ASP.NET Page life cycle .
|
|
|
|
|
How do I change active view when ScriptManagers OnNavigate event fires?
On button control click all is ok, however, when user clicks browsers back button fires OnNavigate.
It allows to change label.text property and it displays correct, but multiview shows old view
It`s nothing to wory before something happen and when it happents it`s alredy to late to wory!
|
|
|
|
|
Found what caused problem.
I forgot to add scriptmanager as triger to updatepanel, however, why there is no hint everywhere i`we looked about that.
It`s nothing to wory before something happen and when it happents it`s alredy to late to wory!
|
|
|
|
|
Dear All.
when i used the code below :
Dim con As New SqlConnection(connection string)
Dim cmd1 As New SqlCommand
Dim ds As New DataSet
Dim da As New SqlDataAdapter
Dim dt As New DataTable
con.Open()
cmd1.Connection = con
cmd1.CommandText = "SELECT Statment"
da.SelectCommand = cmd1
da.Fill(ds, "[Table Name]")
dt = ds.Tables("[Table Name]")
Label1.Text = dt(0)("Column Name")
con.close()
i got the error msg below :
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30367: Class 'System.Data.DataTable' cannot be indexed because it has no default property.
the error is here :Label1.Text = dt(0)("Column Name")
when i searched for the problem i found on MSDN site : the solution is to set the default property !! and i didn't understand what is that mean ?!
thank you advanced
best regards,,
|
|
|
|
|
Bannoota wrote: Compiler Error Message: BC30367: Class 'System.Data.DataTable' cannot be indexed because it has no default property.
The error message says it completely.
You are trying to select the first table from a table.
This line should be:
Label1.Text = dt.rows(0)("Column Name").ToString()
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thank you all
Finally i found the solution:
instead of writing :Label1.Text = dt(0)("Column Name")
i wrote Label1.Text = dt.rows(0)("Column Name").tostring
and it works
Good Luck
|
|
|
|
|
Hello,
I have a gridview on my aspx page which is bounded to a SqlDataSource. SqlDataSource selects some rows from DB and gridview displays the results. Results are like;
Code / Point
------ / -----
FRA / 234
USA / 230
RUS / 228
GBR / 225
I want to add a new image column to gridview, and show the flags of countries on that column. I store the flag images on a folder, and flags are named like FRA.jpg, USA.jpg etc..
So i need to read the "Code" column and get the flag from folder with the text in "Code" column. As a result i will display all results from SqlDataSource plus one extra column which data of extra column will change according to the results.
Is this possible ?
Regards,
Ilker.
there are 10 types of people in the world, those who understand binary numbers and those who dont..
|
|
|
|
|
ilker_ege wrote: Is this possible ?
Yes, it is.
You need to modify/construct the table with one more column for the image.
Once you have the information from the database, loop through the all the rows and for each row read the image from the folder and add the image to the datatable.
I would also think of keeping the flag images in the database and get them as a result. This would prevent me to read the images from the folder.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thank you for your response. But instead of the ways you offered, i tried a different solution.
I added an ImageFied to my DataGridView and also i put the flags of countries in a folder under my website.
For the SqlDataSource Select Command, i added another parameter to select statement; like, "SELECT NATION_CODE, '~/images/Flags/'+ NATION_CODE +'.GIF' AS FLAG ... FROM ....... ". So the query returns the nation codes and the folder path for the images.
I select the ImageField and typed 'FLAG' for the DataImageUrlField property, so it follows the result of sql query.
By this way, i did not store the images as binary data on my tables. This was important for me, cos the data on the table was changing so frequently. Also i did not loop the gridview for the second time, so page loads quicker. My start point was finding nation code somewhere in codebehind, but the final solution seems much more better.
Anyway, thank you for your answer, that makes me think how i can use DB, so i got the solution..
there are 10 types of people in the world, those who understand binary numbers and those who dont..
|
|
|
|
|
hi,
I am using a griview inside an update panel.When the gridview renders it occupies the space of another division below it.It is making my layout slightly different from what i want.But when I don't use the update panel,my layout is ok.
regards
Bill
|
|
|
|
|
Hi, Ive just started using vs2008
im trying to call a method in a parent aspx page from a user control.
ive usually done this using something like:
((PageClass)this.Page).Method();
But for some reason PageClass never appears in intellisense...
- I cant reference the page class from the control - this is very strange
Ive put the page and the control in the same namespace but still no luck.
Ive also tried using events instead - but after the event is assigned in the parent it still seems to be null in the control...
Any ideas what im doing wrong??
Thanks,
Chas
|
|
|
|
|
I am looking for a simple search form that a user enters in their search criteria then the script searches a DB for results and displays them on a new page. Any links to pages or help will be greatly appreciated.
sk
|
|
|
|
|
What kind if data you want to search If the data are in DB, then just read the data in dataset and display in different page. You can use GridView, Repeater or XSL to render the result in page.
Let me know if any problem.
|
|
|
|
|
If you don't know how to do this, if you don't even know where to start, you should turn off the computer and read a book on ASP.NET.
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,
Currently am working with ListView control.
my question is.
button1 click, Listview data has to load and have to edit and insert operation have to do in C#.net code behind.
If am clicking button2,in the same listview, data has to load from different table and have to edit that data.
I hope solution for my query.
Thanks in advance.
--
With Regards,
Muthu
E-mail: mmuutthhuu@gmail.com
|
|
|
|
|
Show your code what did you done so far,or make more clear your question.
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
|
|
|
|
|
Before you search further please have a look into this link[^].
I think this would give you a proper explanation on using a list view.
Keep me posted if you face any issue.
|
|
|
|
|
Arindam,
I have just gone through your blog, and its very cool. And Thanks for adding my blog in your Blogroll.
I need one quick help from you. Can you please help me on that ? I need to chage the my blog address bar icon (like you add your photo( I guess thats you ).
I know how to do it in programatically in our web site but I am not aware of Wordpress settings .
Just for offline discussion, please drop me a mail on my mail id ( Check from my profile ).
Thank you !
|
|
|
|
|
Hard luck for me..Could not find your email id
modified on Saturday, August 1, 2009 11:04 AM
|
|
|
|
|
Done !
|
|
|
|
|
It's good having supporters like you.
My best regards.
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
|
|
|
|
|
Thank You !
|
|
|
|
|
How to design asp.net popup screens
ML Lingwati
|
|
|
|
|
LucBite wrote: How to design asp.net popup screens
Use JavaScript window.open
window.open ("http://CodeProject.com",
"mywindow","location=1,status=1,scrollbars=1,
width=400,height=200");
|
|
|
|
|
i have configured my application in windows 2003 OS and also in windows 2008 OS
when i am browsing reports in windows 2003 its opening properly but when i browse the same page from windows 2008 server its taking almost 10 minutes time to open it .. can any one suggest what to do !
|
|
|
|