|
jophinmichael wrote: Because of this I am having two problems.
1. They are not getting loaded because the previous location of images folder is changed are changed.
2. How I can make these images also dynamic according to the theme applied
AS you are applying theme Dynamically, it means you are applying either Theme or css to the pages. Create Different CSS which having the different images. So that will resolved your problem.
One more thing try to apply your theme in Page_PreInit() event
Hope this will help you .
|
|
|
|
|
Hi Abhijit,
Sorry for this late reply.I think I did not explained my problem properly.
I tried app themes and it is working fine for me.So I am able to apply different themes according to the users who are signing in.But In my aspx pages there are some html images like the following
. But I wanted to load different images according to the theme which is getting applied.
So now I am planning to do something like the following
for my green theme and
for my red theme and in the class I will provide the src for the image .
I am not sure whether this is the proper way of doing it.
So if this is not the right way can you suggest me a better way.
Regards
Jophin
jophin
|
|
|
|
|
Do as Abhijit says,it'll resolve your problem.Use different css files according to theme and aplly them according the theme
|
|
|
|
|
Hi,
On my form, I have a dropdown list, iframe and a button
Source of Iframe is given by the button click javascript.
My dropdownlist selected item is 0
document.getElementById("MyFrame").src = "http://myapp/processing.aspx?ddl=0" ;
works fine
My dropdownlist selected item is 1
document.getElementById("MyFrame").src = "http://myapp/processing.aspx?ddl=1" ;
works fine
My dropdownlist selected item is 0
document.getElementById("MyFrame").src = "http://myapp/processing.aspx?ddl=0" ;
Doesn't work fine. It somehow remembers this link. When I debug, it doent visit Processing.aspx .Processing page internally redirects to a different page. I find that other page is loaded directly visited.
I always want the processing page to be visited. When I delete the cookies before i again select the drop down list item as 0 then it works fine. What is the remedy of this?
Thanks,
Vijay
|
|
|
|
|
It is difficult to diagnosis the problem with this description. Can you please post the entire javascript code?
|
|
|
|
|
It could be something as simple as making sure the processing page is set to not be cached.
|
|
|
|
|
yes i fixed it by not caching the page
thanks for the help.
vijay
|
|
|
|
|
Seems simple enough....Am using C# VS2008.....just trying to pass the text value of a selected item in a listbox to a text box so it can be evaluated for an SQL statement.
string year = ListBoxYears.SelectedItem.Text;
...but it fails with the following error reported:
NULL REFERENCE EXCEPTION was unhandled by user code:
Object reference not set to an instance of an object.
I am also unable to get the "selectedindexchanged" event to work as it does in C# desktop...that is to say, for it to post a changed value to any other control when a change is made in the list box;
I have tried a number of different techniques to retrieve the string, but all to no avail. I have reset the AutopostBack both on and off...no difference. And I have tried to use all of the different properties and conversion available for a listbox that could have anything to do with a string or that might be converted to a string.....no results. Obviously, my frustration level is at 100% now.
ANY assistance would be greatly appreciated....Pat
|
|
|
|
|
The SelectedItem always null if nothing selected in the listbox. So you have to validate whether the SelectedItem is null before retrieve the value.
PDTUM wrote: I am also unable to get the "selectedindexchanged" event to work as it does in C# desktop
The SelectedIndexChanged event will fire only if you set the AutoPostBack is true.
|
|
|
|
|
Thank you for your reply...I changed the AutoPostBack to true on both controls and have tried every variation of it being on and off. The following error is reported when it runs:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 445: protected void ListBoxTrans_SelectedIndexChanged(object sender, EventArgs e)
Line 446: {
Line 447: TextBoxTrans.Text = ListBoxTrans.SelectedItem.Text;
Line 448: }
Line 449:}
Any other ideas?
|
|
|
|
|
Did you debug the code? Place a break point and find out the origin of error and which object is null.
|
|
|
|
|
Are you populating your list box in the page load by any chance? If so, it could be that you're not checking if the page is posting back. You might need something like this...
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
}
}
|
|
|
|
|
YES YES YES DoctorMick....that DID it. I had the list boxes initially loading in the Page_Load event and it was being confused by the postback. I do not use ASP.NET that often and sometimes have trouble migrating from C# applications....THANK YOU very much.
I am having an issue with WEB Posting on another application, which works perfectly in the desktop browser but is also giving a NULL exception error when is is running online (losing SESSION values). I will be posting that a little later today. I hope you have a moment to give it a look....and thank you all for your responses...much appreciated...Pat
|
|
|
|
|
Yes...with the debug active, the error occurs immediately upon selection of the item in the listbox when the "SelectedIndexChanged" event fires, so selecting an item does trigger the event. It just reports a NULL value even though an item is selected. It seems simple enough and I am thoroughly confused about why.
|
|
|
|
|
We are using AjaxPro2 and have following code:
JSTextTransfer.aspx
<script language="javascript" type="text/javascript">
function Getajaxfunction()
{
var flag = TextTransfer.CallAjaxFunction("Test");
alert(flag.value);
}
</script>
JSTextTransfer.aspx.cs
public partial class TextTransfer : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(TextTransfer));
if (!IsPostBack)
{
}
Btn_Ajax.Attributes.Add("onclick", "javascripe:return Getajaxfunction();");
}
[AjaxPro.AjaxMethod]
public string CallAjaxFunction(string atr)
{
return "Test";
}
}
We get the following error:
TextTransfer is undefined.
The page is hosted on a server which has the following directory structure
/htdocs/
/htdocs/bin/AjaxPro2.dll
/htdocs/mysite/JSTextrTransfer.aspx (and .cs)
The tech support says the url which refers AjaxPro has to be changed.
We changed the web.config entries to:
<scriptReplacements>
<file name="prototype" path="http://www.mysite.com/ajaxpro/prototype.ashx" />
<file name="core" path="http://www.mysite.com/ajaxpro/core.ashx" />
<file name="converter" path="http://www.mysite.com/ajaxpro/converter.ashx" />
</scriptReplacements>
Still no luck.
There is a 4th line for ashx in 'view source'.
<script type="text/javascript" src="/ajaxproTextTransfer,App_Web_jstexttransfer.aspx.5d7ed009.aexw4iuf.ashx"></script>
How can this dynamic entry be added in the web.config? Is this what is causing the error?
Or is there any other solution to overcome this?
Thanks in advance.
|
|
|
|
|
What is AJAX Pro ? Do they not have a forum ? I believe most people here use the ASP.NET AJAX extensions.
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.
|
|
|
|
|
|
Hiiiiiiii..........I am creating n number of text dynamically,and saving them in database and heading for all these text boxes is already saved in db and i m updating data of textbox in same database wid respective heading............but when i m going to save it updates last value to all fields. for e.g. if i m wrote ONE in last textbox then that value will be updated in all columns. My code is :
Dim id As Integer = Request.QueryString("ui")
Panel2.Visible = True
Panel4.Visible = True
Dim cmd2 As String = ("Select Specification from DefineSpecification where CategoryID=" + id.ToString())
Dim rdr2 As IDataReader = db.ExecuteReader(CommandType.Text, cmd2)
Dim conn As New SqlConnection
Dim cmd As New SqlCommand("Select Count(*) from DefineSpecification Where CategoryID=" + id.ToString(), conn)
conn.ConnectionString = ConfigurationManager.ConnectionStrings("See2Buy").ConnectionString
conn.Open()
Dim count As Int32 = Convert.ToInt32(cmd.ExecuteScalar())
While rdr2.Read
Dim lbl = New Label()
lbl.Text = rdr2.Item("Specification")
Dim cmd3 As String = "Insert into Specification(ProductName,SpecificationHeading)Values('" + txtProductName.Text + "','" + lbl.Text + "')"
Dim dbcmd1 As DbCommand = db.GetSqlStringCommand(cmd3)
db.ExecuteNonQuery(dbcmd1)
For i As Integer = 0 To count
Dim txtCtrl As TextBox = DirectCast(Panel4.FindControl("txt" & (i + 1)), TextBox)
If txtCtrl IsNot Nothing Then
TextBox1.Text = txtCtrl.Text
Dim cmd4 As String = "Update Specification set SpecificationDescription='" + TextBox1.Text + "' where ProductName='" + txtProductName.Text + "' AND SpecificationHeading='" + lbl.Text + "'"
Dim dbcmd As DbCommand = db.GetSqlStringCommand(cmd4)
db.ExecuteNonQuery(dbcmd)
End If
Next
End While
|
|
|
|
|
Looks to me like you insert the same value from the textbox all the time. Your code is also bad for other reasons. The most obvious one - I can erase your database any time I like, because you do nothing to protect against SQL injection attacks.
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.
|
|
|
|
|
KhandelwalA wrote: I am creating n number of text dynamically,
Where did you crated the textbox? means in which event? If you are not creating dynamic textbox before Page_load() . and best to create in Page_PreInit() . Because all Postback data and ViewStore data restore just before Page_Load().
So if you create dynamic textbox before page_laod it will not able to hold the viewstate or postback data.
|
|
|
|
|
I am facing the following problem.
i have a solution file having more than one asp.net-c# project file.
I have added Web setup file to the solution and then add->group option, then the primary output and the content file of all the project to the setup project.
Then I have built it. And then installed it. This all the process was successfully done.
A virtual directory was created too.
But when I want to browse the site, i can see all the html pages. but no .aspx file. then I have discovered that there is no .aspx.cs file in the location.
I am deploying a project for the first time.
Please help.
Thanks in advance.
Anujit Karmakar
Software Programmer
|
|
|
|
|
Good Day Anujit
There are Different types of Deployment , Some don't have the CS some do have. In the Properties -->MSBuild Options, you will find that there is an option that says "Allow precompiled site to be updatable" or others , if one one them are checked then uncheck them and build your setup again and install it and the CS Files will be in your destination file.
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Anujit wrote: but no .aspx file. then I have discovered that there is no .aspx.cs file in the location.
aspx file should be there. but there should have no aspx.cs file. And the reason is the deployment of web application (publishing). I will suggest you first read the article, then let me know if any doubts
WS Publishing
|
|
|
|
|
hi,
I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically?
regards
Bill
|
|
|
|
|
this should help[^]
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.
|
|
|
|