|
In fact your solution gives my an idea which will furfill my needs... I can count till the desired number of characters, let's say 140 and then truncate the string as soon as the next space occures, or if character 140 is in the middle of a html tag, as soon as the tag ends....
Thanks for bringing up the lighbulb above my head
|
|
|
|
|
Yeah that is correct. You are most welcome
Rate this message. Thank you. Harini
|
|
|
|
|
Hello ALL,
I have an ASP page acting as a parent window from where I open a new third Party(lets say yahoo.com) child window, I am able to control the child window position on the screen but wht I also want is that I want the bottom half of the child page to be displayed when it loads in the window..? Any suggestions on this??
Thnks all!
|
|
|
|
|
Erhm, I think I don't understand your question... Do you mean you want to scroll down that window to the bottom while it loads, and then scroll up when loading is done?
|
|
|
|
|
below is an javascript example
var popup = window.open('WebForm2.asp')
popup.document.body.onload = 'self.scrollTo(x,y)';
HC
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
This little issue is really freaking me.
I have this vanilla web service that returns a typeed DataSet (DataSet1). The web service works fine in IE and also with a test application.
But when I try to use WebService Studio to test the web service, it gives me the following error:
c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(523,14) : error CS0260: Missing partial modifier on declaration of type 'DataSet1'; another partial declaration of this type exists
c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(664,26) : error CS0102: The type 'DataSet1' already contains a definition for 'DataTable1RowChangeEventHandler'
c:\Documents and Settings\atul.dua\Local Settings\Temp\d3y5tjap.0.cs(668,18) : error CS0260: Missing partial modifier on declaration of type 'DataSet1.DataTable1DataTable'; another partial declaration of this type exists
Does any one has any clue whats wrong with web service studio.
NOTE: I am using .NET 2.0 / VS 2005
Atul
|
|
|
|
|
Partial classes allow you do devide classes into multiple files... for example
file1.cs contains
<br />
namespace one.two.three<br />
{<br />
partial class four()
{<br />
public const string a = "a";<br />
}<br />
}<br />
and file2.cs contains
<br />
namespace one.two.three<br />
{<br />
partial class four()
{<br />
public const string b = "b";<br />
}<br />
}<br />
The compiler would think the same of those two files, as if it was a single code file containing
<br />
namespace one.two.three<br />
{<br />
class four()
{<br />
public const string a = "a";<br />
public const string b = "b";<br />
}<br />
}<br />
(not the partial modifier is missing in the class declaration)
Now when you use this feature (which is very usefull and handy by the way) you MUST use the 'partial' modifier in each code file containing the same class... In other words, if either the class declaration in my example above (code file file1.cs and file2.cs) misses the partial modifier, your compiler doesn't understand what you want and gives that message.
|
|
|
|
|
Will anyone help me in building a sample website in Asp.net with c# or VB.net code behind, where the application has to follow the .net layers, a simple web service.. i need that the UI interact with a web servivce and web service interact with business layer, and business layer interat with data layer and database. The database can be simple database with one or two table and a stored procedure in it..We ghave to call only the sp to store and fetch the datas from UI. The main purpose , i want to understand the .net layers concept through this application..
Will anyone plzz guide me in this...
Advance thanks
umashanker
|
|
|
|
|
|
The link explain the N-tier Application in VB.net windows application. What i need is the same concept implemented in ASP.net web application. If anyone provides me, its more useful..
Anyway thanks Rakeesh for your kind help..
Advance thx to anyone gives me the sample in ASP.net web application with C# or vb. net code behind..
|
|
|
|
|
how to keep the imagebuttons in the order like table or grid view?
please answer this question please........
vamsivs
|
|
|
|
|
Place then in a table control
User ImageIndex control
Load their default pic through code
take you pick.
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
Hi All,
How I redirect parent page to another page with a query string when child page is closed using javascript.
Please any help regording to this.
Thanks in Advance.
|
|
|
|
|
You can't redirect it as there is no request to redirect.
You can use Javascript to change the location property of the parent window.
Example:
window.opener.location='http://www.guffa.com';window.close();
---
single minded; short sighted; long gone;
|
|
|
|
|
use the onunload event of the body tag on your popup page to change the location of the parent page
example below
<body onunload="window.opener.location.href='Webform2.aspx'"
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
Hi
I have seen ASP.NET 2.0 tutorial video about role management. When I create any role mangement, on that time the whole database is beeing copied to my Application.
What I would like to do is........
Without UserName and Password no one can view my website. I dont need to create user or send mail if the user forget their userName and password. I dont want to copy the whole RoleManagement database. Because It takes 10.2MB space.
How Can I do it?
Thanks
Sarfarj Ahmed
|
|
|
|
|
Hi,
Ihave a datagrid that Insert data in some rows. One column has RadioButtonList that contains three Items. But When I select one radiobuton, insert data in other columns and select insert data The radio button unselects itself. Why would this be happening? here is my code.
DataTable table = new DataTable();
private DataTable Fill()
{
SqlDataAdapter adapter = new SqlDataAdapter("select * from dbo.DashBoard", con);
adapter.Fill(table);
return table;
}
private void Bind()
{
dgis.DataSource = table;
dgis.DataBind();
}
private void InsertEmpty()
{
table.Rows.InsertAt(table.NewRow(), 0);
}
private void dgis_ItemCommand(object source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// stop editing
dgis.EditItemIndex = -1;
switch (e.CommandName)
{
case "Insert":
//dgis.EditItemIndex = e.Item.ItemIndex;
break;
case "Update":
System.Web.UI.WebControls.TextBox st=new System.Web.UI.WebControls.TextBox();
st=(System.Web.UI.WebControls.TextBox)e.Item.Cells[5].FindControl("txtobjach");
System.Web.UI.WebControls.TextBox st1=new System.Web.UI.WebControls.TextBox();
st1=(System.Web.UI.WebControls.TextBox)e.Item.Cells[4].FindControl("txtobj");
System.Web.UI.WebControls.TextBox st2=new System.Web.UI.WebControls.TextBox();
st2=(System.Web.UI.WebControls.TextBox)e.Item.Cells[3].Controls[0];
System.Web.UI.WebControls.TextBox st3=new System.Web.UI.WebControls.TextBox();
st3=(System.Web.UI.WebControls.TextBox)e.Item.Cells[2].Controls[0];
System.Web.UI.WebControls.TextBox st4=new System.Web.UI.WebControls.TextBox();
st4=(System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0];
System.Web.UI.WebControls.RadioButtonList st5=new System.Web.UI.WebControls.RadioButtonList();
st5=(System.Web.UI.WebControls.RadioButtonList)e.Item.Cells[0].FindControl("rblmood");
SqlCommand myCommand=new SqlCommand();
myCommand.Connection=con;
myCommand.CommandText="insert into DashBoard (ObjectiveAchieved,Objective) values (@ObjectiveAchieved, @Objective)";
myCommand.Parameters.Add(new SqlParameter("@ObjectiveAchieved",SqlDbType.Text));
myCommand.Parameters["@ObjectiveAchieved"].Value=st.Text;
myCommand.Parameters.Add(new SqlParameter("@Objective",SqlDbType.Text));
myCommand.Parameters["@Objective"].Value=st1.Text;
myCommand.Parameters.Add(new SqlParameter("@Workinghrs",SqlDbType.Char,45));
myCommand.Parameters["@Workinghrs"].Value=st2.Text;
myCommand.Parameters.Add(new SqlParameter("@Loggedout",SqlDbType.Char,45));
myCommand.Parameters["@Loggedout"].Value=st3.Text;
myCommand.Parameters.Add(new SqlParameter("@Loggedin",SqlDbType.Char,45));
myCommand.Parameters["@Loggedin"].Value=st4.Text;
myCommand.Parameters.Add(new SqlParameter("@MoodToday",SqlDbType.Text));
myCommand.Parameters["@MoodToday"].Value=st5.DataValueField;
con.Open();
myCommand.ExecuteNonQuery();
con.Close();
dgis.EditItemIndex=-1;
BindDataGrid();
break;
case "Cancel":
break;
case "Edit":
// begin editing
dgis.EditItemIndex = e.Item.ItemIndex;
EditCommandColumn ecc = (EditCommandColumn) dgis.Columns[6];
ecc.UpdateText = "Insert";
//dgis.EditItemIndex = e.Item.ItemIndex;
break;
}
// fill and bind
Fill();
InsertEmpty();
Bind();
}
Thanks.
|
|
|
|
|
Hi,
I'm new to ASP/Javascript so this may be a farily straight-forward question. I have an ASP2.0 website that uses calls javascript functions. When I create the javascript functions in the asp page, there's no problems whatsoever.
However, I also created a class called MyServer in a seperate js file which has been added to the project. I can never call the class or public methods from inside the aspx page though. For example:
<script> type="text/javascript">
var ServerCheck : MyServer = new MyServer();
ServerCheck.MethodOne();
..
</script>
returns an error. I know the javascript class is okay, because it works when compiled (jsc in VS) and run as an exe!
|
|
|
|
|
What you described doesn't make a whole lot of sense but sounds like you haven't added the external script file to the page. Try this
<script type="text/javascript" src="path/to/js/file.js"></script>
stick that in the head element before your script above.
|
|
|
|
|
breen25 wrote: returns an error
Standard question #2:
What error message do you get?
breen25 wrote: I know the javascript class is okay, because it works when compiled (jsc in VS) and run as an exe!
That the code works when compiled as JScript.NET does in no way imply that it can be used as Javascript. On the contrary, I think that it's nearly impossible to write any useful code that would work both as JScript.NET and Javascript.
---
single minded; short sighted; long gone;
|
|
|
|
|
So the javascript code looks something like:
public class MyServer extends System.Net.NetworkInformation.Ping<br />
{<br />
var testServer = "Foo";<br />
var timeOut = 5000;<br />
var pingReply : System.Net.NetworkInformation.PingReply<br />
<br />
public function RunServerCheck() : String<br />
{<br />
try<br />
{<br />
pingReply = this.Send(testServer, timeOut);<br />
return pingReply.Status;<br />
}<br />
catch(PingException)<br />
{<br />
return "Could not contact server!";<br />
}<br />
} <br />
}<br />
public var ServerChecker : MyServer = new MyServer;
The 'var ServerChecker : MyServer = new MyServer;' initilisation
does not seem to be legal in ASP.Net.
|
|
|
|
|
That is not Javascript at all. That is JScript.NET.
You can't use JScript.NET-code as Javascript, just as you can't use C#-code as Javascript, or use this weeks tv guide as Javascript.
Although Javscript and JScript.NET has some similarities, there are some crucial differences:
Javascript does not support inheritance.
Javascript can not use .NET framework classes.
Javascript does not have data types.
Javascript does not have access modifiers.
There are a lot more differences, but those are the ones that makes it impossible to use your JScript.NET-code as Javascript.
---
single minded; short sighted; long gone;
|
|
|
|
|
Yes, but I was hoping such JScript code could be invoked in an ASP page
as javascript is.
|
|
|
|
|
It can, but only if you use it as server code and call it from the server. You can't use it as client code, and you can't call server code directly from the client.
---
single minded; short sighted; long gone;
|
|
|
|
|