|
|
Iam new to ASP.Net 2.0 I want to know how to change the position of any control (Text box, label etc) from one place to another place. Iam unable to drag the control.How is this possible?
Thanx in advance
|
|
|
|
|
Where you want to drag the controls ? In designer or at the runtime in browser ?
|
|
|
|
|
Hai prasanna
U do this --Go to Tools-->Options-->here u willl find a herarchy of Options like Environmet,Performence tools,....HTML Designer click it---->Choose
CSS Positioning-->Check both the checkboxes -->click OK
now u can place the controls where ever u want
|
|
|
|
|
Hi Yuvachandra, Thank you for your reply
|
|
|
|
|
I am new to asp.net 2.0 and i am badly confuse....Any help which can point me in a correct direction...
When we should use SqlDataSource and when we should ado.net datareader etc...What are the criteria to choose.....
Please help...
Amit
|
|
|
|
|
The SqlDataSource control allows a developer to access data stored in any relational database that supports ADO.NET. It can use the System.Data.SqlClient provider to access a SQL Server database, the System.Data.OleDb provider, the System.Data.Odbc provider, or the System.Data.OracleClient provider to access Oracle. Therefore, the SqlDataSource is certainly not only used for accessing data in a SQL Server database.
In order to use the SqlDataSource, you simply provide a value for the ConnectionString property and specify a SQL command or stored procedure. The SqlDataSource control takes care of working with the underlying ADO.NET architecture. It opens the connection, queries the data source or executes the stored procedure, returns the data, and then closes the connection for you.
Regards,
Satips.
|
|
|
|
|
Thanks...But when we should go for SQL DataSource option vs command/datareader/dataset in real world...
|
|
|
|
|
What container control do you use on a page
to hold the embeded COM object from a RCW?
Thanks,
|
|
|
|
|
What's the COM type you're trying to embed? Does it spit out it's own HTML or does it depend on a plugin to display in a browser? In either case, you're better off creating a user control to hold your embedded control so that you have greater flexibility in managing the output to the browser. If it's not plugin based, you can just put it within a DIV.
SG
|
|
|
|
|
You're talking WAY over my head. It displays just fine in the
<object> shown below. I guess that means it gens it's own HTML?
..within a DIV...like this?..this is still at design time.
How do I reference it from the code behind? I need to capture
the selectedIndexChanged event and process it there. The version
below (- the Div) uses VBscript in the Window_Load event.
<object classid="clsid:D76D712E-4A96-11d3-BD95-D296DC2DD072" height="154"
="" id="fg" style="LEFT: 0px; TOP: 264px; position: absolute;" width="438">
Thanks for helping..
|
|
|
|
|
Check the "Ignore HTML tags in this message" checkbox the next time you post some HTML.
The answer to your question is No. The design time "object tag" is no assurance that your control emits it's own HTML. Let me give you a simple example.
When you embed a Flash movie in your web page, you only get to see the "object' tag during design time. And Flash player does not emit any HTML on it's own. When a client requests your webpage, the browser looks at the "Object" tag, reads the clsid and finds if it has a suitable plugin to parse the object. It'll find that the clsid matches that of the Flash player. It then substitutes the actual flash player in the browser in place of the "object" tag. In other words, the player you get to see in the browser is installed in the "client" computer.
An example of COM controls that emit their own HTML would be the various chart controls, grid controls and maybe even Crystal reports(Im not 100% sure of this) that just remains a gray object during design time and metamorphosizes into colorful HTML in runtime.
As to whether you can reference the control in code behind, I'm not very sure of this. It depends on how your COM control was built. I know that you can control Windows Media Player plugin at runtime using vb Script. I'm pretty sure that you can also do it from the code behind classes, although I believe that you need to explicitly convert the control using CType or something similar before you can use it's properties. But as I said, I'm not too sure of this.
Hope this helps.
Regards,
SG
|
|
|
|
|
WOW!..are you GOOD or what?!..using the clsid from my 1st
message, can you render the page completely?..I have an
.aspx that shows the grid, but I also have the DLL installed
there, as I'm testing on the same machine I develope with. I
can access the events of the grid only using VBScript, since
(OBJECT) isn't visible to the code behind, but VBScript
is real unreliable..
Sub grd_SelChange
This works:
if true then grd.(property)=123
This doesn't:
if a=1 then grd.(property)=123
end Sub
does (a /the) grid (as you suggested) emit HTML itself..??
Try putting a standard COM object with a UI from Windows
(DbGrid):
Dim Grd As New DbGrid
on a code behind(.VB) and see if you can "connect it" to the
.aspx I would be happy to do either early or late binding,
but I'd rather do late, if I need to so I can handle its events
in the back end, and avoid using VBSript. I have limited
experience with VBS, but it can't see global vars or methods,
session objects or even app objects??..or am I doing something
wrong?
|
|
|
|
|
Since it looks like you're using a Grid control, I'm sure you can access it's properties using late binding. Perhaps you can try
Dim Grd as new DbGrid
Grd = Ctype(Page.FindControl('Your Grid ID'), DbGrid)
I think you should be able to get hold of your actual grid.
I dunno if the "Object" tag supports the "runat" attribute. The above code will fail if not so.
Best of Luck!
Regards,
SG
|
|
|
|
|
The Object tag supports "runat=server", but when I
use it, I get a compile time error?..you try it..
use the <object> snippet I had..curious to see if you
get a different result.
I'd like to see VBS that big..I'm impressed!..5000 lines.
Why can't I get a simple If statment to work?..
Thanks for your help..
|
|
|
|
|
VB Script is not too bad. I've seen pretty complex code written in VB Script that creates Adobe Illustrator graphics, some 5000 lines for each template. The author apparently wrote the whole thing in notepad. I had to do maintenance on that piece of code, and it was like being dumped in the middle of the Amazon rain forest and asked to hack my way out. In VbS You just need to do things the harder way, that's all. Having seen .NET, VB Script will seem pretty ungainly and complex. It's just a matter of finding suitable workarounds for the things that are available for granted in VB.NET.
Regards,
SG
|
|
|
|
|
Imports MSDBGrid
Imports System.Runtime.InteropServices
Imports msdatasrc
Partial Class _Default
Inherits System.Web.UI.Page
Public WithEvents dbTestGrid As DBGrid
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'*** this returns "Nothing" setting dbTestGrid = "fg"..??
dbTestGrid = CType(Page.FindControl("fg"), DBGrid)
'*** this also returns "Nothing" but I tried.
dbTestGrid = CType(Page.FindControl("fg"), Object)
With dbTestGrid
.FontName = "Verdana"
end with
'*** aren't we trying to do the opposite assignment?
Page.FindControl("fg") = dbTestGrid
End Sub
End Class
_Default.aspx
...
<object classid="clsid:D76D712E-4A96-11D3-BD95-D296DC2DD072"
="" height="189" <b="">name="fg" id="fg"
style="LEFT: 0px; TOP: 0px" width="726">
|
|
|
|
|
Try
<object classid="clsid:D76D712E-4A96-11D3-BD95-D296DC2DD072"
runat="server" height="189" name="fg" id="fg"
style="removed: 0px; removed: 0px" width="726">
and then try out the Type conversion.
SG
-- modified at 8:30 Thursday 24th May, 2007
|
|
|
|
|
SG:
Sorry, I tried that before my last mail, I just forgot to
mention it. I get a compile time error:
Error 9-Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
...and (of course) it does..??..
Can you throw together a quick project of the same 6-7 lines
and replicate the problem?..dont think there's anything wrong
with my installation / setup.what can can it be? Had a suggestion
to try to use the __DoPostback from the client side.
I'd like to try and avoid using client scripts, as they are not
compiled, and there are things I need to do in the events that
expose connection strings and encryption that I really don't want
the user seeing.
Although I've seen the __doPostBack before in code, I'm fairly
new at this and don't know anything about it. I will look it up on
MSDN and code project. If you have a sample of how to use it
from the client, I'd love to see it. Come to think about it, most all of
the Interop articles I've seen dont go into any detail regarding the
rendering of COM objects..simply using their properties and methods,
which (even at my level) is not a big deal. The advanced articles will
occasionally give some detail to events and delegates.
What would be real nice is a (asp:object) that "bridges" the 2 page
model, allowing me to assign a clsid: at runtime and process events
in the .aspx.VB code behind.
Regards (and Thanks),
B.Griffin
|
|
|
|
|
Sorry if this question has already been answered... I'm new to asp.net and I've searched for an answer to no avail.
I'm trying to generate xml dynically to display a chart using a flash chart tool (xml/swf). The basic format I need for the xml is:
- <chart>
- <chart_data>
- <row>
<null />
<string>Constant 1</string>
<string>Constant 2</string>
<string>Constant 3</string>
<string>Constant 4</string>
</row>
- <row>
<string>Constant 5</string>
<number>(variable 1)</number>
<number>(variable 2)</number>
<number>(variable 3)</number>
<number>(variable 4)</number>
</row>
</chart_data>
</chart>
variable 1-4 are pulled from an Access DB dependent on a variable passed from the default page.
If anyone can point me in the right direction, I would greatly appreciate it!
Sorry for the problem with the code... I think I have it worked out now. It's strange. It looked fine in the preview. Sorry I just signed up for the forums today after finding a bunch of helpful posts and users. And it's not homework. It's a project I'm working on for a wedding website for my wife and I.
-- modified at 0:04 Tuesday 22nd May, 2007
|
|
|
|
|
1) Use the Ignore HTML tags checkbox to make your post more readable
2) Sounds like homework
only two letters away from being an asset
|
|
|
|
|
Sometimes some of my session ids loose their values when navigating from page to page on my an ASP .Net site causing errors. This happens when using Microsoft IE. When I run it in Foxfire this does not happen. What could be the problem?
|
|
|
|
|
FoxFire??
Browsers dont have anything to do with missing session variables. Session variables are stored in the web server and the browser does not have any control over their lifetime or value.
1. Check your code to see if the session variables are being reset anywhere you dont want them to be
2. The default session duration in IIS is 20 minutes. If you're in a page longer than that, doing nothing, then that session is considered as "closed"
Regards,
SG
|
|
|
|
|
I think it depends on what kind of session storage is being used: passing the session ID through the URL or using cookies. I want to say the cookie method is default. I have some session variables declared with everything at default. When I open up the developer toolbar in IE 6, I can clear the session cookies. That will effectively grind my application to a halt on the next postback. I can't find where the hell this session ID is so I can't say without a doubt that's what is going on.
|
|
|
|
|
This is correct with .Net session ID's are now stored in cookies and they are somewhat encrypted which is why you can't find them. In ASP they were server side but that can create a load. You can change where the session ID's are stored and if you have a small audience I would say do it server side. Hope this helps.
|
|
|
|